kongondo Posted July 18, 2016 Posted July 18, 2016 In a module-context, as we know, stuff like single file or image fields return 'arrays', i.e. become iterable. This means that directly using WireArray::Iterable() to check whether a field is iterable can be misleading. Other than to temporarily set a page's output formatting to true (still within a module context), checking iterability of a field on the page, then reverting the page's output formatting to false after the check, is there another/a better way to achieve the same feat? Thanks.
LostKobrakai Posted July 18, 2016 Posted July 18, 2016 I think changing the output formatting will be the most reliable way to check if a field is working like our file fields as it's working no matter what you throw at it. I'd imagine anything else being dependent on the actual implementation of each of those fieldtypes. 2
kongondo Posted July 18, 2016 Author Posted July 18, 2016 Thanks Benjamin. That's how I am doing it at the moment but was worried I could affect other fields in that short instance I do the check..before reverting back. I was probably being paranoid...
LostKobrakai Posted July 18, 2016 Posted July 18, 2016 PHP isn't running in parallel (besides using ReactPHP), so if it's affecting anything it's certainly not your fault 4
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now