BrendonKoz Posted November 2, 2017 Share Posted November 2, 2017 I must obviously be doing something wrong in my hackish attempts to develop a Fieldtype. The inputfield and fieldtype are installed successfully, but as soon as I attempt to create a field using the fieldtype, I immediately (upon submit of the field creation form) receive a 500 error. It took me awhile to realize that ProcessWire was snatching the error message away from the server though! Error found in: /site/assets/logs/error.txt: Quote 2017-11-02 13:43:07 ? http://127.0.0.1/?/ Error: Call to a member function hasPermission() on null (line 1287 of C:\Users\bkozlowski.SARWIN2K\Desktop\UwAmp\www\pw_plugin_test\wire\core\Modules.php) This was a completely clean install of PW v3.0.78 running the classic theme. Immediately after setup I installed my "under development" fieldtype module and the above occurred. I'm uncertain where to look since this seems to be referencing hasPermission in a core file, but as far as I'm aware I wasn't referencing permissions in my (inputfield and fieldtype) modules. I've attached my files if anyone wants to take a quick look, but I'm still confused why a core file might be rendering the error. Someone else had this issue with their site during a module update, so perhaps it's a versioning issue (I very well may be mixing old PW module code with new)...https://processwire.com/talk/topic/16358-error-call-to-a-member-function-haspermission-on-null/ FieldtypeBook.info.json FieldtypeBook.module InputfieldBook.module OpenLibraryBook.php Link to comment Share on other sites More sharing options...
Robin S Posted November 2, 2017 Share Posted November 2, 2017 FieldtypeBook.info.json: { "title": "FieldtypeBook", "version": "0.0.1", "summary": "Field that stores one or more books with optional metadata.", "author": "Brendon Kozlowski", "icon": "book", "href": "", "permission": [ "" ], "autoload": false, "singular": true, "permanent": false, "requires": [ "PHP>=5.6.0", "ProcessWire>=2.5.28", "" ], "installs": [ "InputfieldBook" ] } The "permission" option here is the problem. Remove all the cases where you are setting items to "" - if you don't need to set a value for an option then simply don't include it in the JSON. { "title": "FieldtypeBook", "version": "0.0.1", "summary": "Field that stores one or more books with optional metadata.", "author": "Brendon Kozlowski", "icon": "book", "autoload": false, "singular": true, "permanent": false, "requires": [ "PHP>=5.6.0", "ProcessWire>=2.5.28" ], "installs": [ "InputfieldBook" ] } 2 Link to comment Share on other sites More sharing options...
BrendonKoz Posted November 3, 2017 Author Share Posted November 3, 2017 I'd have never looked there. In fact, I know I didn't since I searched for the text string of "permi" in my *.php/*.module files. Dang. Thank you so much! Now I can fix all the other errors and continue on. Thank you!!!! 1 Link to comment Share on other sites More sharing options...
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