I'll say it again, this is a very useful module!

I'd like to have the ability to approach the read-only mode form checks using a white-list approach. i.e. block all form submissions except for the ones listed (things like the login and search forms) as we seem to have a lot of forms which need to be caught, but only a few which are critical to site operation.

Whilst this would mean some might be missed, these would simply be an inconvenience to the user until they are whitelisted. Rather than the alternative which is that user data is accepted and then possibly lost during a site transition which is just plain bad news for the user.

Is this a useful enhancement for this module? i.e. If I implemented this, would you consider this enhancement against this module?

We are currently running Drupal 6 here so initial code implementations would be against v6, but could probably also port to v7 as needed.

Comments

BarisW’s picture

Hi Pete,

I like that idea. I am thinking of making it more generic. So just to block ALL form submissions for a given role, except the ones whitelisted.
The current approach only adds the functionality for some given forms, which is a pain to manage (as new forms come up every day).

So yeah; a whitelist would be nice. However, I won't work on D6 anymore.
If you are about to write a patch, then please also submit a D7 version as well ;)

petew’s picture

I was also thinking of making the white-list configurable. There's bound to be situations where a local site has local/custom forms which they still want to allow submissions for if they only query data.

Or would you prefer to avoid that approach?

petew’s picture

The attached patch is the sort of approach I was thinking. There might be other forms which we should allow by default.

Also worth noting this is a functional change to the current module approach and might restrict forms which users otherwise expect to be available, only login, search and the node content list are currently allowed, but i'm sure there's many more we should also allow.

Initially I tried to address the form validation separately, however a little bit of refactoring was needed in order to address that and also this item.
The patch addresses the following: (let me know if you would rather these were broken out into separate patches, i've included them both together as they were touching the same code so seemed more complicated to try and split apart)

The patch:
1. assumes bug patches submitted for #1883258: Errors generated when accessing forms in read-only mode and #1883310: Notice message not displayed to users have already been applied. (to avoid clashes assuming those bug patches are okay)
2. addresses #1882266: Add read-only mode checking on form submission (as that needed a small code refactor anyway to avoid duplicating code)

If you want any changes to these or anything submitted differently, just let me know.

As i'm primarily developing on D6 for the project i'm currently working on, I've included a D6 patch too, as it's subtly different with the #markup change. (again it assumes the patch for bug #1883258: Errors generated when accessing forms in read-only mode has been applied) Hopefully if you accept this, you would also consider patching the D6 branch too if I provide the patches?

This enhancement patch has been sponsored by Haymarket Media Group (http://www.haymarket.com/)

Many thanks,
Pete

petew’s picture

Actually, on closer inspection of the actual patch file it doesn't appear to be quite as I expected, and won't patch cleanly after the mentioned bugs (#1883258: Errors generated when accessing forms in read-only mode and #1883310: Notice message not displayed to users) have been applied. Sorry about that. I used 'git diff' to produce the patch and hadn't spotted it.

Attached a corrected patch.

I originally reported this as a 6.x feature request, but this patch is for 7.x as requested as the main development release.
Will provide a 6.x patch once confirmed whether this 7.x approach is suitable.

petew’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
StatusFileSize
new6.18 KB

Attached is a patch against current 7.x-1.x-dev which contains the suggested enhancements for your consideration towards the white-list idea.

In addition to the last patch, this patch includes slight refactor improvements to the code submitted in the previous patch, and in particular adds support for admin configuration of allowed forms, so that site administrators can more easily configure the module as needed. (thereby hopefully avoiding too much of an issue should we have any missing forms which ideally should be in the allowed list)

Let me know if this is the sort of thing you were thinking, whether it's suitable or anything else needed?

damontgomery’s picture

petew,

Thanks for all this awesome work. I like the idea behind your approach, but I haven't tested it yet.

The current maintenance mode doesn't make any sense for us and any live site and this seems to solve the majority of the issues. Different use cases will require different actions disabled. For example, all of our webforms send emails so we don't need to block them (in fact we can't block them or our users can't submit forms). Similarly other webforms or forms may perform actions that interface with systems outside Drupal and we don't need or want to disable these.

Since you've done a lot of work here and I'd love to help out with testing, could you provide a concise list of patches (and order) for testing on Drupal 7? The information seems spread over multiple posts / threads and I'm finding it a bit confusing.

Thank you!

petew’s picture

Hi pandaeskimo,

Great news, it would be great for more to test this feature enhancement to see whether it would benefit everyone.

Sorry for the confusion with the patches, as you can see there was a flurry of activity towards this this week with various things, and BarisW has already kindly patched the dev release with a couple of the bug patches I submitted.

All you need do to get this working is apply the single patch contained in comment 6 against the 7.x-1.x-dev release. You will then have the enhancement i've implemented. It has the ability to specify form names so you can add forms you wish to allow as exceptions to the read-only mode, which may help solve your situation.

If the patch doesn't apply/work for any reason then please let me know and i'll investigate.

Many thanks, and I look forward to your feedback and suggestions,
Pete

damontgomery’s picture

Status: Active » Needs review
StatusFileSize
new6.85 KB

Pete,

I did some testing and am submitting a new patch that extends yours and fixes a bug I found. It seems to work really well though, nice job. My patch can be applied directly to the current dev release.

The fix was that you couldn't edit the maintenance mode form and return to normal operations because those two forms were not on the default whitelist. I've added them and we're good.

The extension was to allow wildcards in the list. This way you can use 'webform*' to get all Webforms. This functionality is shared with the Context module so it should be good for users.

To make the wildcard switch, I had to re-write that portion of your patch from a set of in_array functions to slightly more complex preg_match functions using the regex anchors ^ and $ to make plain entries like 'my_form' require exact matches.

I've tested it in our environment and it seems to work well.

Not related to this patch, for Drush use you can call "drush vset site_readonly 0" to turn the read only mode off.

petew’s picture

Hi pandaeskimo,

Perfect! The wildcard option was the one remaining item I was thinking of implementing, but as I didn't need it just yet I avoided implementing something I wasn't going to be able to fully test before supplying a patch. Plus I wasn't sure when starting to submit this patch whether it would gain any momentum.

Thanks for doing that. The code changes you have made look great.

BarisW’s picture

Status: Needs review » Needs work

I like where this is going. Thanks for all the hard work.
I've committed the patch to the dev branch. It still needs some bit of love, so I'm waiting until that's done before I add a new release.

Some remarks:

- The form descriptions could be a bit more descriptive. Eg: 'Allowed' and 'Allowed for view only'. I'd suggest something like 'Forms that can be posted' and 'Forms that can be viewed'. Also: 'Configure which forms will be exempt from restriction when in read-only mode.'. Exempt from restriction? Huh?
- I'd suggest to add a permission for users that are allowed to skip readonlymode validations, instead of just user 1.
- I've add #states on the form so that Readonlymode is only visible when the Maintenance Mode checkbox is checked.
- Check Drupal coding standards. It's TRUE instead of true. Comments need to be on their own line, and we use single quotes in arrays instead of double quotes. I've applied most of those coding standards but will check once more.

damontgomery’s picture

Thanks for the cleanup. There are two issues currently with Dev (both killed the module completely). I've submitted a patch.

1. The state check means that maintenance mode MUST be enabled to turn on Read Only Mode. If maintenance is on, the site can't be accessed anyway, so there isn't much point to the Read Only Mode. I think the use case is that Read Only Mode is a better maintenance mode that keeps content accessible while removing creation / editing (DB changes).

2. The conditional needs to start with FALSE ||. The current state allows access to all forms since the check always returns TRUE.

(sorry about some of the inconsistencies with Drupal standards, I've been focusing on JS for a while recently and some of the conventions there pulled over. I think all your cleanup looks good though.

(PS, I'm going to start a new thread with a build out of permissions so that we can allow access to admin users if needed. It's not my use case, but I can see why you'd want it.)

damontgomery’s picture

Priority: Normal » Major
Status: Needs work » Needs review

changing state of this issue.

damontgomery’s picture

I have done the work with the permission here, http://drupal.org/node/1888550.

BarisW’s picture

Status: Needs review » Fixed

I see your points, and I think they are valid.
I've committed your patch and the other one #1888550: View Forms Permissions as well.

Please review.

BarisW’s picture

By the way; this is a nifty edge-case: content that is not created by users, #949920: Content created by FeedAPI, core aggregator module.

damontgomery’s picture

Status: Fixed » Closed (fixed)

Yes, I've left some comments in that thread. Let's change this to closed so it's no longer in the queue.

BarisW’s picture

Status: Closed (fixed) » Fixed

Guys,

please test the current dev and let me know if it's okay like this. If so, I'll add a new release of the 7.x branch.

petew’s picture

Hi BarisW, i've been through and ported this to D6, and in the process have sanity checked things. A couple of questions:

1. user_pass form has been added as an allowed form. Using the DTAP example from the README.txt this means users can change their password during read-only mode, but would get reset back to their original password. This seems like it will confuse users. Better to not allow password resets during this time? Or, we implement with an additional state which presents a warning message saying that any changes made may be reset etc but allow them to submit anyway.

2. In readonlymode_check_form_validate it has changed to a drupal_set_message call, which means the form will still submit okay. It needs to be form_set_error so that it fails validation and therefore prevents the form submission.

Attached is a small patch to address 2 and also move the $viewonly preg_split line into the IF statement for performance reasons. Plus tidied up a comment.

petew’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
StatusFileSize
new13.43 KB

I've taken the 7.x-1.x-dev code which is related to this issue and have ported it for 6.x-1.x-dev.

I've kept everything done to date in 7.x-1.x-dev related to this except for the permissions specific items #1888550: View Forms Permissions, as I should really patch that separately once tested and agreed final. (plus we may decide there's no need in backporting that one as may be deemed D7 specific?)

Update: I should have also mentioned, the backport includes the doc updates too, so we keep everything aligned.

petew’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
StatusFileSize
new1.78 KB

A further tidy up of the regex matching code so that we don't have code duplicated.

This patch is to be applied after comment 19 and 20 patches are applied. To be applied to both 6.x-1.x-dev and 7.x-1.x-dev. (tested patch against both and should apply fine)

damontgomery’s picture

Pete,

Thanks, here are my thoughts on the warning. Setting a warning AND a form error shows duplicate messages. We need to prevent validation, but not show duplicate messages. For this reason, I think the messages for not being able to submit the form (validation error) and the normal form prevention are different.

One is an optional message in the interface config and one doesn't exist. Do you get duplicates with your approach?

Can't we just do


return FALSE;

For the form validation and use the standard message or use an additional message (warning) such as "The site is in Read Only Mode so this form was not submitted. Please return once the site has returned to normal activity." or something like that.

I'm not a forms expert. I find the Drupal forms API very confusing so your help would be appreciated.

For #1, I think the password reset option should be disabled during read only mode by default. I don't see why you'd want it enabled and you can do so with whitelist now if you have a weird use case.

Pete, I like the work to move a lot of this stuff to D6. Would it make more sense to wait for a new 7.x official release and then batch backport all the stuff at once to D6. A LOT was changed in 7.x and it was almost completely re-written which would make managing a ton of little patches very difficult. At this point, you may also be the only one to be able to test it and should maybe be added as a maintainer for the 6.x branch if you're up for it.

I think with most of this work we should have a very flexible module, but you never know what's in the future.

damontgomery’s picture

Status: Fixed » Needs review
StatusFileSize
new5.37 KB

Pete,

I have rolled up your two patches and fixed the issues presented by Baris's clean-up. These are all included in my single patch for 7.x-dev.

First, the warning was showing up when the mode was OFF since Baris you keep changing my conditionals like (variable_get('site_readonly', FALSE) === 1)) to !variable_get('site_readonly', FALSE). First, those are the opposite loose comparisons (easy to make a mistake like that so no worries) and second, one measures the actual stored variable and the other dives into truthy checks which are so muddled I don't think it's a good idea. Is this a standards thing? The DB stores TRUE as 1 and FALSE as 0, so I check for those numbers in case they somehow end up as something else. 'cleaning up' the code has resulted in several of these switches so far so I should either write it the way it will be (the shorter way), or it shouldn't be changed. (I'm a little picky about truthy checks since I've had issues in other parts of Drupal where they cause a LOT of trouble.)

Next, I added a new custom message. This is a message that is shown when the user tries to submit a blocked form. I've done my best at wording, but it's customizable. The reason for this (as stated above) was to prevent duplicate messages as warnings AND errors right next to each other. It looks like we have to use form_set_error or the form will validate, which is a bummer. I think they should be different actions, but that's what we have.

To summarize the intended messages
Non-admins : warning that site is in Read Only Mode when on a page with a blocked form
Non-admins : error after trying to submit a blocked form (also see the message above)
Admin with permission : warning that site is in Read Only Mode and that others cannot access the form when on a page with a blocked form.

Everyone will see some sort of warning when on the blocked form as a reminder of the forms state.

I have also tested all the changes Pete made, so this patch should work under all the conditions such as whitelists, defaults, permissions, etc.

Thanks for the work. I think this issue queue is getting messy. If this looks good, my recommendation is to roll it into a 7.x release and then start separate threads for new issues or as a comprehensive 6.x release. There are only the 3 of as at the moment and even now it's getting confusing! ;)

petew’s picture

Status: Needs review » Fixed

Hey,

The only official way i'm aware of for ensuring the Form API validation handler flags a validation error with the form thereby not allowing the form to complete its submission is by using the form_set_error function. I'm not seeing the double error message any more, though perhaps my testing cases are slightly different. I'm not 100% sure which of the messages you are seeing twice, could you clarify?

I must admit I normally avoid calling drupal_set_message during a form/form_alter function as it often ends in doubling up of messages during form validation. The form is parsed twice, once to validate the inbound submission, and then again when the form is generated for display. If you add any kind of AJAX into the form then that adds to the messages too. (though adding the FALSE as the third argument does solve this)

The error in D7 that I am currently seeing is the following. When loading a form (eg node/add/page) as a normal user when the site is in normal mode, then switch the site to read-only, when the user submits their form I get the following errors:

Notice: Undefined index: form_token in drupal_validate_form() (line 1124 of includes/form.inc).
The form has become outdated. Copy any unsaved work in the form below and then reload this page.
Notice: Undefined property: stdClass::$type in _node_extract_type() (line 371 of modules/node/node.module).
Notice: Undefined property: stdClass::$type in _node_extract_type() (line 371 of modules/node/node.module).
EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7633 of includes/common.inc).

I've checked it on two site builds here and i'm seeing the same thing. Let me know if you're seeing the same issue.

I haven't done too much testing of the code on D7 yet. I'll try and do more this week if I can help towards getting a 7.x release out. Much of what has been pushing me forward on this is with sites on D6 currently, so i've been testing D6 more than D7 up until now.

Happy to wait for the D7 release to happen and then backport. I normally avoid that approach as I don't like too much to stack up and then have a large batch to do at the end. I normally favour keeping up-to-date with ports so that they are reasonably aligned and up-to-date and can be tested close together. That way when i'm testing one it doesn't take too much more to test another, plus it's fresh so the use cases and test cases are clear. Happy to go with whatever works for the Drupal issue management system. Ideally on an issue-by-issue basis would work best rather than by release. You'll have probably noticed all the backporting i've done currently has tried to keep each issues patch files separate even for the backports. I'm guessing it's fairly easy to see what issues have been addressed between two releases so backporting goals can be clearly seen? Are shared feature/issue branches common or really just used on local git repos, with only the normal Drupal 7.x-1.x branches making their way to the central drupal.org git project repo?

I agree with the user password reset form being left as restricted (I assume that's the user_pass form, although i've just realised I may have assumed based on the name) so we should remove that form id from the list.

More than happy to assist with maintaining the D6 port for this module.

BarisW’s picture

Regarding the user_pass form; in it's basic concept in can be used to retrieve a login to login to the site.
The link brings you to the user account form where you CAN change your password.

If we only enable the user_pass form (like I did) and leave the account page out of scope, I believe a user cannot change it's password, but can still login when he forgot his password.

petew’s picture

Status: Fixed » Needs review

Hey, sorry, seems I took so long to finish typing my previous reply I ended submitting it after your followup comment.

Regarding the TRUE and FALSE values in the database, my understanding is that the variables table stores the data with the serialize() function, and boolean values are denoted by the 'b' with either a 1 (TRUE) or 0 (FALSE) value and are returned to normal TRUE/FALSE boolean values when unserialized. Therefore we should be dealing with TRUE/FALSE values rather than matching 0's and 1's in this particular instance.

Apologies if this issue has bloated out of control, probably due to my verbose comments. Feel free to tell me to keep them shorter if appropriate! :)

petew’s picture

Re comment 25: Checked (which I should have done earlier!) and confirmed, you are indeed correct.

damontgomery’s picture

No worries. Let's regroup.

Are you getting the error in #1882296-24: White-list approach on form checks with my patch #1882296-23: White-list approach on form checks?
I am getting this part of the message, but I don't know exactly why, "The form has become outdated. Copy any unsaved work in the form below and then reload this page." I'm not getting the PHP errors.

Are you still confused about the reason for the duplicates?
One was an error, the other a warning.

Is there an issue with the variable calls?
We have two functions that just call variables (I expanded the module using previous code as an example) and other situations were variables are accessed with truthiness or absolute (===) values. What are the best practices here or does it matter?

Are there any blockers or what do we want to do in order to close up these related feature additions?
I think there has been a lot of work here recently and I'd like to see a well working point release to offer the community. If there are better ways of approaching that, we could improve that later such as concerns for specific forms like user_pass. There could be an issue for working on default white-lists. In that regard, is it better to just remove all default white lists and then set the default (editable) list to our "default"? That could be addressed in another issue.

To your point, I feel like it's best to deal with individual issues in their own threads, but since this module is so small and it's been completely refactored recently, it may make sense to make an exception in terms of the 6.x release. I don't deal with any D6 sites, so I'm not sure how those backports are typically handled.

Thanks again everyone!

petew’s picture

I've updated patch 23 with the following items: (updated patch is attached which applies cleanly on the current 7.x-1.x branch)

1. I prefer the as you put it 'truthiness' approach. I think it's cleaner and easier to read.
Using the other approach of the identical comparison operator (===) to test for equality and also check whether they are of the same type, with a boolean on the left it will convert the 1 on the other side to a boolean as well, and therefore I believe should achieve exactly the same thing. It is a personal preference, I typically favour the clearer and shorter code where possible.

I've adjusted the code to the truthiness approach, which is inline with Baris's original code, and ensured the logic is correct. (I hope!)

2. When we clear out the form, i've also cleared out the #after_build handler. We don't want other things trying to alter the form after we have cleared it out. I think this was partially the cause of the additional errors we were seeing.

3. The 'The form has become outdated' error was to do with the way the Form API works. I've adjusted things so that we retain the key FAPI build/token items. I've tested and things play nicely now. If you were editing something while Read Only mode was activated, you can successfully submit it once read-only mode is disabled. (So long as the form_build_id/token is retained on the server side, and I guess there's a timeout of some kind for the form token though I haven't checked but so long as that hasn't been reached, then forms should be accepted when returning from read-only mode.)
Another note: There may be an argument in the future for some not wanting this to happen, like if you've done a major upgrade/content-layout change on your staging server while in read-only mode, then data layout might have changed when returning from Read-only and you'd want users to edit from a fresh copy. That's a specific case and we'll cover it later should anyone request it. I suspect the simple solution to this scenario is to flush the form cache thereby invalidating any existing forms that might be out there.

4. I feel that we need to show at least something in the form when we clear it out. The status message is above where the form content would normally appear, and possibly on some sites in another place altogether, so it might not be immediately obvious when the user gets a blank/empty area. I've added a message in place of the form content. This does mean that we have two warnings (or more if there's more than one form on the page) but I think this is okay, it makes it clear to the user in the status messages area what's going on, and the form content gets a warning about the form not being available at this time.

An alternative I thought about was to show all elements but make them all disabled. However I wonder whether we could reliably parse the form and update them all to be disabled. For the time being I figure just stick with clearing out the form.

5. I've changed things slightly with regards the double error/warning message. I was only seeing the double message when I have a form open, the site enters RO mode, and then I attempt to submit the form. When that happened I got something like:

  • Warning: Test site is currently in maintenance. During this maintenance it is not possible to add or edit content (like comments and pages).
  • Error: Data not saved. Test site is currently in maintenance. During maintenance it is not possible to change content. Please make a note of your changes and try again later.

I've adjusted things and I now only get the Error 'Data not saved' type message, there's no warning when that occurs in that scenario.
Could you test this patch and see if you are still getting double messages at other times too? If so, could you detail exact steps to reproduce?

Summary
I've changed a fair few things in a few places to do all of the above, adjusted some of the text, moved the messages into a fieldset as the maintenance system form was getting a bit out of control otherwise. Perhaps if these are suitable, and initial testing looks good, we could get this patch applied before we start providing any further patches towards this issue?

Hopefully we are getting close to ironing out the issues and errors with this feature. If we can test it over the next couple of days and confirm that we have closed any outstanding issues and errors we find during testing, and also show confidence we haven't introduced any other bugs along the way, maybe we'll be able to close this feature as fully tested and get a new release tagged up in a few days.

Daniel, I think I covered all of your items in your last comment and fingers crossed everything is now working correctly.

Baris, I hope we haven't overwhelmed you too much with the amount of sudden activity on this module this week :)

damontgomery’s picture

Pete,

I like the ideas behind most of those changes and I'll try and get a chance to test it today or tomorrow.

In terms of the equality testing, I think this is an area PHP / JS / Drupal developers really do a poor job. Truthiness testing in PHP is extremely bizarre. in_array() uses == and take a look at this bizarre behavior:

Using PHP interactive mode (php -a)

php > var_dump((0 == 'TRUE'));
bool(true)
php > var_dump((1 == 'TRUE'));
bool(false)
php > var_dump((int)'TRUE');
int(0)

That's right, the string for 'TRUE' is equal to 0. Do you know why? PHP tries to convert strings to numbers, since there are no numbers, it returns 0 and sets it to bool(true). But 'TRUE' is not equal to 1 since it also evaluates to 0. This may be a minor concern, but then consider when TRUE booleans are represented by keywords like "checked" and these are checked with, in_array('checked', array(0)) which returns TRUE! Code like this is in popular Drupal modules. Lastly, statements like "($variable === TRUE)" are clear, straight forward, and only perform one function. Statements like "(!$var)" requires mental gymnastics to determine the purpose of the statement and what may happen. Are we checking if the variable exists, or if it's set to anything, or should the variable be a truthy value like 0 / 1 that we need to test for?

/rant

Save a sea turtle, use strict conditionals!

petew’s picture

Such are the ways of weakly typed languages. I typically refer to the language reference manual when it comes to these sorts of edge cases as I wouldn't assume all languages operate the same.

With regard your examples:

php > var_dump((0 == 'TRUE'));
bool(true)
php > var_dump((1 == 'TRUE'));
bool(false)
php > var_dump((int)'TRUE');
int(0)

The first two are loose comparisons between a string and a number. (A useful type comparison table is available http://php.net/manual/en/types.comparisons.php)

The 'Comparison with Various Types' table at http://php.net/manual/en/language.operators.comparison.php is helpful too.

PHP defines its approach as: If you compare a number with a string or the comparison involves numerical strings, then each string is converted to a number and the comparison performed numerically.

Then, for string conversion to a number, this is defined here http://php.net/manual/en/language.types.string.php#language.types.string...
as: If the string starts with valid numeric data, this will be the value used. Otherwise, the value will be 0 (zero).

So for your examples, based on the language definition I would expect:

  1. 'TRUE' to be converted to 0 as it's just a string, giving the comparison 0 == 0, giving a result of boolean TRUE.
  2. 'TRUE' to be converted to 0 as it's just a string, giving the comparison 1 == 0, giving a result of boolean FALSE.
  3. 'TRUE' to be converted to 0 as it's just a string, which becomes (int)0, giving a result of integer 0.

Perhaps not what you were hoping to hear, but hope that helps in some way.

damontgomery’s picture

Pete, I DO know how PHP does this, but most people do NOT. There is NO benefit of using shortcuts like if(!$var) except for brevity. It isn't more clear and it isn't as useful. It means another coder needs to know what type of variable you're dealing with since you don't make it clear and it DOES cause issues when things change. We'll leave it as is and if things change they may break. My examples of actual problems were from popular Drupal modules (I believe Ctools or VBO). Try to deal with jQuery updates and Drupal and it's a nightmare because of the way people who don't understand either very well use these sorts of loose checks and how jQuery keeps changing it's return values.

Back on track.

I'm encountering a weird issue. When I am logged in and a form is submitted while ROM is turned on in the middle, the form is saved (and shown). However, if I am an anonymous user, the form is NOT saved. This seems to happen only with webforms, but I haven't done extensive testing. I believe we should move forward and make another issue for that issues since this current thread is a huge mess. We haven't been talking about whitelists for a while (since that was solved early on in the thread).

I fixed another 'issue' or cleaned it up. I believe we only need two of the custom error messages, the first is when you get to a form when it's not available. The second is when you submit a form and are blocked. The third is no longer needed now that you re-write the second situation's form error and place it inside the form's location. I have updated your patch with those changes. It's cleaner and makes more sense.

BTW, I think the current dev branch is broken. We may want to get that working before we make sure it's polished.

BarisW’s picture

Status: Needs review » Fixed

Apologies for being offline for a few days, some work projects needed my attention.
Thanks again for all the hard work. Pete, Daniel, thanks for an amazing job.

I've tested the patch thoroughly and I believe we have fixed the most use-cases.

I've added one more form to the list of allowed forms; the module overview. When in Maintenance mode, it can be quite handy to be able to disable or enable a module (for those without drush).

Committed to dev. Let's close this thread and open a new issue if we want to continue improving this.

BarisW’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Fixed » Patch (to be ported)

I've just created a new release, 7x-1.1.

Let's backport this to D6. Anyone?

petew’s picture

Assigned: Unassigned » petew
Status: Patch (to be ported) » Fixed

Backported.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.