Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: deekayen commentedComment #4
kenorb CreditAttribution: kenorb commented+1
Comment #5
webadpro CreditAttribution: webadpro commentedHi,
I have added the possibility to add it to only the form you really want.
For Drupal 6.
Comment #6
mtcs CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: Nikro as a volunteer commentedOh damn, okay I didn't search before so I did my patch.
Basically it does the following:
Comment #11
Nikro CreditAttribution: Nikro as a volunteer commentedComment #12
glynster CreditAttribution: glynster commented@Nikro you are a rockstar this makes the module even better! +RTBC
Comment #13
dbassendine CreditAttribution: 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 CreditAttribution: IRuslan as a volunteer and at DrupalJedi 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 CreditAttribution: 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 CreditAttribution: IRuslan as a volunteer and at DrupalJedi 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 CreditAttribution: 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 CreditAttribution: IRuslan as a volunteer and at DrupalJedi 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 CreditAttribution: bwaindwain as a volunteer commentedWe're using patch #14 and it works great for us.