Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
So I downloaded the latest dev for D7 and found that it wasn't quite working yet. I took a couple hours to get things patched up and working basically the same way it works in D6 for now. Just looking to get a couple other eyes on it to make sure i didn't miss anything here.
Comment | File | Size | Author |
---|---|---|---|
#16 | save_edit_p0.patch | 2.16 KB | icampana |
#13 | save_edit_D7.zip | 8.87 KB | Martin Mayer |
#10 | portToD7-1137362-10.patch | 8.72 KB | crantok |
#7 | save_edit_D7-1137362-2.patch | 9.16 KB | Finn Lewis |
#1 | portToD7-1137362-1.patch | 8.91 KB | aaronott |
Comments
Comment #1
aaronott CreditAttribution: aaronott commentedNeeded the issue number for the patch.
Comment #2
junander CreditAttribution: junander commentedSo far, working for me. I'm also using the Fieldgroup module and it seems to be playing nice. Really glad to have this, definitely streamlines content entry.
Comment #3
Marcel Tuchek CreditAttribution: Marcel Tuchek commentedwhen will this patch turn into a dev version? i can't get the patch runnin. "no such file or directory" .. i just cannot handle the terminal.
Comment #4
jeffwidman CreditAttribution: jeffwidman commented+1 to get this into dev
Comment #5
aaronott CreditAttribution: aaronott commentedI've tested this but I also created it, so i can't mark this as tested. Can someone else look through the patch, apply it, and test it? This will help getting it to dev much faster.
Comment #6
bbbo CreditAttribution: bbbo commentedI could apply the patch without problems, but get an error
Notice: Undefined index: article in save_edit_form_alter() (Zeile 146 von /homes/path_to_drupal/sites/all/modules/save_edit/save_edit.module).
when opening the node edit form. Probably trivial... if you know PHP :-)
Comment #7
Finn Lewis CreditAttribution: Finn Lewis commentedI noticed there was a 7.x-1.x branch at http://drupal.org/node/479802/git-instructions so, based on the patch in #1, re-rolled the patch against the 7.x-1.x git branch.
This now works for me and doesn't give the 'Undefined index:' notice.
Comment #8
bbbo CreditAttribution: bbbo commentedWorks like a charm. It probably had worked before too, I just noticed that the error appeared when there are no content types checked at admin/content/save_edit , thus
$node_types = variable_get('save_edit_node_types', array());
does return an empty array .I had enabled the content types for initial testing, but for some reason the settings weren't saved corerctly.
Comment #9
crantok CreditAttribution: crantok commentedWorks for me too.
Comment #10
crantok CreditAttribution: crantok commentedOops. Found one error. On navigating to node/add/(node-type) where (node-type) was not in the array of save_edit node types I got this warning:
Notice: Undefined index: lwts_article in save_edit_form_alter() (line 144 of ~/www/lwts/sites/all/modules/contrib/save_edit/save_edit.module).
I solved it by making a small change.
Comment #11
Taxoman CreditAttribution: Taxoman commentedComment #12
simeWorking for me. This is a good patch on an unpublished dev version, there is no reason it shouldn't remain marked ready to commit.
Comment #13
Martin Mayer CreditAttribution: Martin Mayer commentedThe patch in #10 does not work for me as it is, because it omits the save_edit.info file. Here is a complete version of the module for D7. This works for me. Just install and configure as usual.
Comment #14
dazz CreditAttribution: dazz commentedThis works when you edit coming from a node page but not when you click i edit on a page like admin/content. It just goes back to that page.
Comment #15
heylookalive CreditAttribution: heylookalive commented@dazz
Using the zip file from #13, before this line:
add in:
What's happening is that if you come from the content overview page your destination is already set, and drupal_goto will always take whats in
$_GET['destination']
over what you just pass todrupal_goto
http://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_g...
Overall this module is cool :) the above is the only thing I could find wrong.
+1 for commit to dev release!
Comment #16
icampanaJust a little recommendation, at this time the hook used is save_edit_form_alter and that would be called for every form, but what we need is just for the Node form, so it could be changed to this hook "save_edit_form_node_form_alter", and that way it is only called once we are on the node editing form, that avoids having to check if the form is a node editing one.
That's mainly for a bit of performance, on the other hand, the text for the menu is not set to be translatable, it needs to be enclosed in the t() function, for the people wanting to use that module in other language it could be a problem.
I'm also including the fix from #15 and a patch based on #13 in case anyone wants to give a look.
Comment #17
guile2912 CreditAttribution: guile2912 commentedThis module is very usefull, we definitly need a clean D7 version ^^
Here is something that happened to me, and I do not really understand what is happening.
I have a hook_FORMID_form_alter on the content type that save and edit is configured for.
When I do "little" things like $form['field_whatever']['#access'] = FALSE; everything works fine.
But when I do some more heavy modifications in the hook, like adding new fields (my form is using field_group-7.x-1.1 and some field_collection-7.x-1.0-beta4) , the button "Save and edit" changes its ID from "edit-save-edit" to "edit-actions-save-edit", breaking the Save and Edit module because if cointains a
if ($form_state['clicked_button']['#id'] == 'edit-save-edit')
I had to hack it to
if ($form_state['clicked_button']['#id'] == 'edit-save-edit' || $form_state['clicked_button']['#id'] == 'edit-actions-save-edit')
but I dont really understand if this is something that sould not happend or if this something that save and edit has got to take into account.It would also be very cool to have a "Hide preview button" and "Hide normal submit button" options. My contents should always remain in edit mode for example.
Thanks again for the D7 port !
Ho, and we also have that bug found in D6 : save_edit text to use for buttons no longer handles special characters
Comment #18
guile2912 CreditAttribution: guile2912 commentedI pushed a beta 7.x-1.0-beta1 version, mainly the version from this thread with the "Hide preview button" and "Hide normal submit button" options.
Tell me if anything is not working properly !
Comment #19
Taxoman CreditAttribution: Taxoman commentedGreat! :-) So closing this and moving on with separate bug reports.