-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.0.11: Macro was called without parameter condition #11745
Comments
I think it's not a problem with Not sure how it works on 2.0.10 though. |
{% set countdataflag = count_data > 0 %} {{ conditionaldate(countdataflag, tdate, ttime, tz) }} But still the same. |
Well, then i don't know what's going on. Try to pass value of |
I guess it comes from the following change: |
Not it doesn't. callMacro is not executed here. Checked what i wrote above maybe. |
Did you checked maybe what will happen if you will set in php in controller For me it's for 99% that this change is not causing this issue. CompileMacro is executed once compiling view, CallMacro is executed well, when executing macro in compiled view(php). And this exception is thrown only in compileMacro. |
It gets fixed if we mark that parameter as optional. array arguments = [] |
Can you push the fix? |
But this exception which he has is thrown here: https://github.com/phalcon/cphalcon/blob/master/phalcon/mvc/view/engine/volt/compiler.zep#L1911 Is it first called and then compiled then ? |
I'll try to deal |
Not sure if this is related; I am calling a macro with 3 arguments, the first of which is an object. I now get the error; It appears that the compiled macro expects to be called with a single array argument This obviously breaks existing macros so is quite a serious bug for us. |
When can we expect this on the PPA? We just updated this morning and are having the same problem. |
@jellisii We'll try to fix it in |
Thank you sir. I've reverted to a custom build using commit a5f615d as its source for the time being. |
Yea, it must be a bug in compiler, it must call function with arguments as array, for me from 2.0.5 i think were callMacro was introduced it broke functions, filters etc, so that's why i had to do this commit which was mention here. Well it's pretty obvious that was needed to changed, just forgot that there are macros as well and it might broke it. |
* Fixed issue #11745 * Amended Volt tests * Small cleanup
@wiesl Can you please check the 2.0.x branch? |
Thanks for your report. This issue has been fixed in 2.0.x branch. We will release v2.0.12 in coming days with this bug fix. |
Thnx, verified on master. |
Testing looks good. Thanks. |
After upgrading to 2.0.11 I'm getting the following error: Macro was called without parameter condition
Reverting to 2.0.10 works well.
Looks like it comes from the following change:
Any ideas?
https://forum.phalconphp.com/discussion/11419/2011-macro-was-called-without-parameter-condition
Well 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 callingcallMacro
too, and working right now). I don't know why it broked macros.Im 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.
Im 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.The text was updated successfully, but these errors were encountered: