{"action":"created","issue":{"url":"https://api.github.com/repos/phalcon/cphalcon/issues/11745","repository_url":"https://api.github.com/repos/phalcon/cphalcon","labels_url":"https://api.github.com/repos/phalcon/cphalcon/issues/11745/labels{/name}","comments_url":"https://api.github.com/repos/phalcon/cphalcon/issues/11745/comments","events_url":"https://api.github.com/repos/phalcon/cphalcon/issues/11745/events","html_url":"https://github.com/phalcon/cphalcon/issues/11745","id":153201704,"number":11745,"title":"2.0.11: Macro was called without parameter condition","user":{"login":"wiesl","id":10095841,"avatar_url":"https://avatars.githubusercontent.com/u/10095841?v=3","gravatar_id":"","url":"https://api.github.com/users/wiesl","html_url":"https://github.com/wiesl","followers_url":"https://api.github.com/users/wiesl/followers","following_url":"https://api.github.com/users/wiesl/following{/other_user}","gists_url":"https://api.github.com/users/wiesl/gists{/gist_id}","starred_url":"https://api.github.com/users/wiesl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wiesl/subscriptions","organizations_url":"https://api.github.com/users/wiesl/orgs","repos_url":"https://api.github.com/users/wiesl/repos","events_url":"https://api.github.com/users/wiesl/events{/privacy}","received_events_url":"https://api.github.com/users/wiesl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-05T09:56:45Z","updated_at":"2016-05-05T10:05:27Z","closed_at":null,"body":"After upgrading to 2.0.11 I'm getting the following error: Macro was called without parameter condition\r\n\r\nReverting to 2.0.10 works well.\r\n\r\n{%- macro conditionaldate(condition, tdate, ttime, tz) %}{% if condition %} from <br/>{{ tdate }}, {{ ttime }} {{ tz }}{% endif %}{%- endmacro %}\r\n\r\n{{ conditionaldate(count_data > 0, tdate, ttime, tz) }}\r\n\r\nLooks like it comes from the following change: Fixed Phalcon\\Mvc\\View\\Engine\\Volt::callMacro bug. Now it's correctly calling calluserfunc_array instead of call_user_func\r\n\r\nAny ideas?\r\nhttps://forum.phalconphp.com/discussion/11419/2011-macro-was-called-without-parameter-condition\r\n\r\nWell actually it was done to fix custom user functions, filters etc beacause they weren't working(they weren't passing parameters because call_user_func was executed, they are calling callMacro too, and working right now). I don't know why it broked macros.\r\n\r\nIm not sure what has to be done here to make both of them working. You should create an issue on github. You can copy my above explanation why this change was made.\r\n\r\nIm not sure you can use it like this. Can you first try to set count_data > 0 to same variable and then call macro with variable ? Also it's weird that it was working on 2.0.10, it shouldn't too, beacause nothing was changed there, I only changed one function which shouldn't have any effect on this.\r\n"},"comment":{"url":"https://api.github.com/repos/phalcon/cphalcon/issues/comments/217117100","html_url":"https://github.com/phalcon/cphalcon/issues/11745#issuecomment-217117100","issue_url":"https://api.github.com/repos/phalcon/cphalcon/issues/11745","id":217117100,"user":{"login":"wiesl","id":10095841,"avatar_url":"https://avatars.githubusercontent.com/u/10095841?v=3","gravatar_id":"","url":"https://api.github.com/users/wiesl","html_url":"https://github.com/wiesl","followers_url":"https://api.github.com/users/wiesl/followers","following_url":"https://api.github.com/users/wiesl/following{/other_user}","gists_url":"https://api.github.com/users/wiesl/gists{/gist_id}","starred_url":"https://api.github.com/users/wiesl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wiesl/subscriptions","organizations_url":"https://api.github.com/users/wiesl/orgs","repos_url":"https://api.github.com/users/wiesl/repos","events_url":"https://api.github.com/users/wiesl/events{/privacy}","received_events_url":"https://api.github.com/users/wiesl/received_events","type":"User","site_admin":false},"created_at":"2016-05-05T10:05:27Z","updated_at":"2016-05-05T10:05:27Z","body":"{% set countdataflag = count_data > 0 %}\r\n\r\n{{ conditionaldate(countdataflag, tdate, ttime, tz) }}\r\n\r\nBut still the same."}}