These fail silently at the moment, which is a pain.
Probably need to throw an exception so both the UI and drush can react accordingly.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | module_builder-1662726.patch | 644 bytes | Robin Millette |
These fail silently at the moment, which is a pain.
Probably need to throw an exception so both the UI and drush can react accordingly.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | module_builder-1662726.patch | 644 bytes | Robin Millette |
Comments
Comment #1
Robin Millette commentedYou mean as in #1661370: hook_groups.template gives json_decode error ?
Comment #2
joachim commentedYup!
I spent ten minutes chasing the same problem because I was on another machine and I hadn't noticed my git pull hasn't worked... :/
Given that the json template files are meant to be overridden by users, having it just fail silently is rubbish. The UI and drush should both complain about it.
Comment #3
oscardax commentedI'm getting this fatal error when accessing admin/modules/module_builder
It seems to be related to this issue thread.
May there be any dependencies for this module not stated in the documentation?
Thanks!!
Comment #4
Robin Millette commentedYou're right, json_last_error() depends on php >= 5.3.
Might be best to simply check if json_decode() returns NULL to detect errors.
Comment #5
joachim commentedEh crap.
JSON is just rubbish, really isn't it.
Since D8 configuration is now going to be YAML we could switch to that perhaps?
Comment #6
Robin Millette commentedI don't use your module enough to really comment, but my gut is telling me to keep json support in 7.2.x and if you really want it, yaml in 7.3.x and 8.3.x (whenever ;-).
Supporting json shouldn't be too hard and it's included in php since 5.2. yaml on the other hand, you have to install separately.
But like I said, I've never touched the template stuff in Module Builder, so I'm not the best person to comment.
I can submit a patch to replace json_last_error() with a test for NULL on json_decode(). Let me know.
Comment #7
joachim commented> yaml on the other hand, you have to install separately
Good point.
> I can submit a patch to replace json_last_error() with a test for NULL on json_decode(). Let me know.
If you have time, yes please!
Comment #8
Robin Millette commentedThis patch displays (drupal_set_message) an error if there is a problem with the json file. Not using json_last_error() so it should work with PHP >= 5.2.
Comment #9
joachim commentedThanks for the patch! Committed.