Comments (2)
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.
from kirby-imageradio.
Hello,
Thanks for the kind words!
I don't have any issue with the when:
attribute with 3.2, have you given it a shot? I'll close this for more clarity in my tickets, feel free to reopen if the problem is still here.
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.
from kirby-imageradio.
Related Issues (16)
- Screenshot
- Using smaller thumbnails HOT 1
- [Kirby 3] Default value HOT 3
- Trouble with imageradio type HOT 2
- Class 'Kirby' not found in after Update to Kirby 3.0.3 HOT 2
- text: option not work HOT 2
- Change $query['label'] to $query['text']
- Images aren't displayed
- Options dont get saved in blocks HOT 2
- Native multilang functionality HOT 1
- dont work with Conditional fields (when:) HOT 1
- Background for transparent images HOT 1
- imageradio in Blocks HOT 1
- 3.8 compatibility
- Kirby 4 compatibility HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kirby-imageradio.