Agaric wants to know how to deny access to settings form in 4.7
Agaric got this error message:
Cannot use string offset as an array
(in, say, modules/system.module on line 745, as a hypothetical example)
Turns out this is from using return t("Access Denied") syntax when the hook_settings function expects a form array to be returned.
We thought we had the answer and posted as such here:
http://drupal.org/node/22797#comment-240833
But while this effectively denies access, no error message appears and the form is provided as just the save and reset buttons. Not the greatest user interface feedback.
CORRECTION: The above happens when you go to a settings page for a module that doesn't exist (again hypothetically, if you've deleted it and not copied it in again). However' the form buttons still appear below the error message and it'd be nice to get rid of them.
Life is so much better in Drupal 5.
Unrelated background on research into the error:
The fix here - http://drupal.org/node/16481 - made us think the problem was we needed to use FALSE not '' to set empty variables with variable_get
In this case, the problem was not caused by using an empty string, rather than FALSE
.
This may only affect some versions of PHP, so a module could work on one server and destroy everything on the next.
Agaric ran into this problem on Drupal 4.7 (we are not using 4.7 of our own volition).
Agaric got this error message:
Cannot use string offset as an array
(in, say, modules/system.module on line 745, as a hypothetical example)
Turns out this is from using return t("Access Denied") syntax when the hook_settings function expects a form array to be returned.
We thought we had the answer and posted as such here:
http://drupal.org/node/22797#comment-240833
But while this effectively denies access, no error message appears and the form is provided as just the save and reset buttons. Not the greatest user interface feedback.
CORRECTION: The above happens when you go to a settings page for a module that doesn't exist (again hypothetically, if you've deleted it and not copied it in again). However' the form buttons still appear below the error message and it'd be nice to get rid of them.
Life is so much better in Drupal 5.
Unrelated background on research into the error:
The fix here - http://drupal.org/node/16481 - made us think the problem was we needed to use FALSE not '' to set empty variables with variable_get
In this case, the problem was not caused by using an empty string, rather than FALSE
.
This may only affect some versions of PHP, so a module could work on one server and destroy everything on the next.
Agaric ran into this problem on Drupal 4.7 (we are not using 4.7 of our own volition).
Comments
Post new comment