Is it possible to disable this modules functionality on certain forms. I only want it enabled on the body tag of a certain node and not on the search field, login fields etc.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | 7.x-2.x-saveguard-certain-forms-apply-203244-14.patch | 5.15 KB | IRuslan |
| #10 | saveguard-forms-opt-in-out-203244-10.patch | 4.58 KB | nikro |
| #7 | saveguard.diff | 4.65 KB | artfulrobot |
| #7 | saveguard.tgz | 8.89 KB | artfulrobot |
| #6 | saveguard_form_select.patch | 2.26 KB | mtcs |
Comments
Comment #1
nathanraft commentedHere is a rough mod with visibility controls added so that you can choose based on path and roles. Probably needs to be cleaned up and probably could add content type controls as well. If you do clean this up I would appreciate it if you would send me the updated module.
Good luck.
Comment #2
deekayen commentedPatch uses visibility api - need to make sure that's going to upgrade to Drupal 6 since there's not a release node for it yet.
Comment #3
deekayen commentedComment #4
kenorb commented+1
Comment #5
webadpro commentedHi,
I have added the possibility to add it to only the form you really want.
For Drupal 6.
Comment #6
mtcs commentedThanks for this solution!
It seems to work as expected. (More testing is needed though.)
I've attached it as a patch file.
Comment #7
artfulrobot commentedAnother take on the problem: Here's a patch (and a complete module in .tgz file, if easier) that offers 2 config options:
Each option takes form ids, one per line, which can include * for wildcard. So *_node_form is all node forms and * would be all forms. To not break original behaviour, it defaults to * in the "saveguard on change" option.
So option (1) is hopefully clear: you can choose which forms saveguard applies to.
But why option (2)? I hear you ask. Because CKEditor, and possibly others, don't trigger onchange or onkeypress on the textareas they replace. So if you edit a page which defaults to using a Rich Text Editor, you can merrily edit, then hit a link and Saveguard has not triggered the caution; you lose work. Of course, a nicer solution would be to get RT editors to play ball, but I didn't have time to look into that.
Hope this is useful.
Comment #8
deekayen commentedThere are a number of code style violations in #7, mostly tabs instead of spaces. You should not be modifying the version line in .info, either. See http://drupal.org/patch/submit
Comment #9
artfulrobot commented#8 got you. I understand the importance of all that, but haven't had a spare day to climb the rather overbearing learning curve for patches, and to absorb that into an efficient work flow. When I get chance I'll clean up my code and re-post. As it is functioning and possibly useful to others, I thought it was good to share it. Apols if I got that wrong.
Comment #10
nikro commentedOh damn, okay I didn't search before so I did my patch.
Basically it does the following:
Comment #11
nikro commentedComment #12
glynster commented@Nikro you are a rockstar this makes the module even better! +RTBC
Comment #13
dbassendine commentedPatch at #10 works well - thanks! I have only tested "Specify form_id's", though.
One minor improvement I'd make is, in the textarea for the list of form_ids that appears after you click "Specify form_id's" - add a note saying what the format to list multiple form ids is. The only syntax that works is putting a form_id on each line, without any separator. It would save trial and error time to explain that up front.
Comment #14
IRuslan commentedPatch is not relevant for last dev version.
I've updated patch for the last version with several corrections:
- new variables added to hook_uninstall
- added constants for apply mode
- adopted $form['attached'] for proper JS inclusion.
Comment #15
glynster commented@IRuslan thanks for the patch update however on my end the last hunk fails? Any ideas as to why that would happen?
Comment #16
IRuslan commented@glynster
I rechecked and on my end, it applied correctly. Could you ensure you are trying to use dev version of the module to apply against?
Comment #17
glynster commented@IRuslan thanks for the speedy reply. I see there is no available dev version so does this mean I need to be downloading the master from Git?
Comment #18
IRuslan commented@glynster
Yes, correct. That's because dev version is pretty different from the last release.
However, if you want to provide some tests, I could add patch for you particular version. Which one do you use?
Comment #19
oleksiyThanks for the patch #14. Works fine for me only with saveguard 2.x, which is missed on project page and available only in the project GIT repository.
Comment #20
bwaindwain commentedWe're using patch #14 and it works great for us.