phalcon 2.0.11 upgrade fail production!!!

After upgrate from 2.0.10 to 2.0.11 in Volt tamplates has an errors on custom object

Fatal error: Cannot use object of type Util\Unit as array in...

in ppa has no other versions

apt-cache policy php5-phalcon php5-phalcon: Установлен: 2.0.11-build4-ppa1~trusty Кандидат: 2.0.11-build4-ppa1~trusty Таблица версий: * 2.0.11-build4-ppa1~trusty 0 500 http://ppa.launchpad.net/phalcon/stable/ubuntu/ trusty/main amd64 Packages 100 /var/lib/dpkg/status

How fix it? How downgrade?

edited May '16

So you're using PPA. Did you tried to compile it from source (2.0.11v)? Also, post your 'custom object' here.

If it's really issue with latest version and not your code, you can just revert to binary phalcon.so from 2.0.10v.

Compile it from source in any case.

Revert it to binary from 2.0.10. Also you can clone repository tag yourself and compile phalcon yourself.



6.3k
edited May '16

i think i'ts may problem with Volt "macro" functions the code in volt

<?php return ''; ?><?php }; $this->_macros['sign'] = \Closure::bind($this->_macros['sign'], $this); ?><?php $this->_macros['get_temp_color'] = function($__p = null) { if (isset($__p[0])) { $temp = $__p[0]; } else { if (isset($__p["temp"])) { $temp = $__p["temp"]; } else {  throw new \Phalcon\Mvc\View\Exception("Macro 'get_temp_color' was called without parameter: temp");  } }  ?>
    <?php $tempVal = $temp->getValue(); ?>
    <?php if (($tempVal < -36)) { ?>
        <?php return 'm36'; ?>
    <?php } ?>

the code in Volt

{%- macro get_temp_color(temp) %}
    {% set tempVal = temp.getValue() %}
    {% if(tempVal<-36) %}
        {%  return 'm36' %}
    {% endif %}
    {% if(tempVal<-32) %}
        {%  return 'm32' %}
{% endif %}

the object available in https://github.com/cmfcmf/OpenWeatherMap-PHP-Api/blob/master/Cmfcmf/OpenWeatherMap/Util/Unit.php



6.3k

how checkout on 2.10? there is no branche with this name



6.3k

i don't find how to compile 2.0.10 to binary. My solution was to revrite all volt macros to naitive php and now it's work.

You can download here source for 2.0.10 - https://github.com/phalcon/cphalcon/archive/phalcon-v2.0.10.zip

And just compile it as usual.