-
Notifications
You must be signed in to change notification settings - Fork 5
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
Support for 'when:' and nesting inside kirby builder(?) #9
Comments
Having the same issue with using it in Kirby Builder. The issue is caused by an exception that occurs in the 'ratio' prop function: kirby-imageradio/lib/fields/imageradio.php Lines 24 to 35 in 855b7a4
The 'ratio' function is being called multiple times. The first time, it gets the proper ratio value as a parameter. Subsequent times, it is called with its latest return value as the parameter. I.e. first it gets called with "1/2", then it gets called again with 200, causing an exception on line 28. It seems like the calling code (I suppose Kirby Builder) is messing up by calling the prop function again with its own return value. This a temporary fix I applied locally: function ($ratio = '1/1') {
if (is_numeric($ratio)) {
return $ratio;
}
// ...
} When the function gets called again with its computed numeric value, I'm returning that value. |
Hello, Thanks for the kind words! I don't have any issue with the As for the Builder issue, the field should behave properly even when hidden. It seems that the issue is on the Builder's side, you should rather open an issue there. Thank you for the investigation @bertwillekens, and the workaround. I won't add it in the field since there shouldn't be a need for it at all, but it can be of use if Tim doesn't have time to look into it in the near future. |
Hi,
On a side note I have to say that I've been quite impressed by all your plugins so far(!)
So I'm having small issues with the imageradio field. It seems like it does not work when hidden (so either with using the newer 'when' field property or either with putting an imageradio field inside a 'kirby builder').
When doing so, I end up with an error:
'Undefined index: text' (when used with 'when:')
'Undefined offset: 3' (when used inside a 'kirby builder' field)
Has anybody reproduced this?
I wanted to use the imageradio as it's more explicit for grid layout choices :(
The text was updated successfully, but these errors were encountered: