Hi,
I have found an E_NOTICE when I save a node. I attached the patch which solves the problem.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | nodeaccess_userreference.module.1.patch | 865 bytes | tamasd |
| nodeaccess_userreference.module.patch | 869 bytes | tamasd |
Hi,
I have found an E_NOTICE when I save a node. I attached the patch which solves the problem.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | nodeaccess_userreference.module.1.patch | 865 bytes | tamasd |
| nodeaccess_userreference.module.patch | 869 bytes | tamasd |
Comments
Comment #1
tamasd commentedanother one patch
Comment #2
danielb commentedThe first patch will break the behaviour of this module in certain situations because it will set the values to FALSE/0 if they've already been set to TRUE/1 by another field (someone may have a field for 'viewers', and a field for 'authors', for example). For E_ALL compliance the least damaging change to make is turn
if ($var)intoif (isset($var)).In the 2nd patch there is now a double check for isset and is_array which could be simplified by using a !empty instead.
Don't worry about making a patch. If and when I set out to achieve E_ALL compliance I can go through everything by hand.
Comment #3
danielb commentedAnd I would really put E_ALL compliance as a feature since I've only recently started hearing talk about drupal being compliant. The sloppy if tests I use are often taken right out of core of popular contrib modules.
Comment #4
Coornail commentedI think it's an entirely wrong method to handle E_ALL compilance patches.
From the error_reporting php manual site:
Enabling E_NOTICE during development has some benefits. For debugging purposes: NOTICE messages will warn you about possible bugs in your code. For example, use of unassigned values is warned. It is extremely useful to find typos and to save time for debugging. NOTICE messages will warn you about bad style.
These errors refering to bad programming habits, and mostly easy to fix.
(E_NOTICEs can easily changed to E_WARNINGs with a php version update, so it's good for forward compatibility also).
Comment #5
danielb commentedI have no idea what you're saying coornail.
Forgive my ignorance, I am interested in algorithms, data structures, and providing functionality to users. The nuances of how servers are configured and PHP error reporting has generally been the server administrator's problem and something I'm not allowed to touch. I frankly don't know much about E_ANYTHING so I will have to get back to this issue after I've educated myself a bit more.
Comment #6
danielb commentedHave added some changes that should take care of the problem.