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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aaronott’s picture

Status: Active » Needs review
FileSize
8.91 KB

Needed the issue number for the patch.

junander’s picture

So 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.

Marcel Tuchek’s picture

when 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.

jeffwidman’s picture

+1 to get this into dev

aaronott’s picture

I'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.

bbbo’s picture

I 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 :-)

Finn Lewis’s picture

I 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.

bbbo’s picture

Works 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.

crantok’s picture

Status: Needs review » Reviewed & tested by the community

Works for me too.

crantok’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
8.72 KB

Oops. 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.

Taxoman’s picture

Title: Port to D7 » Port Save-and-Edit to D7
Category: bug » task
sime’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

Working for me. This is a good patch on an unpublished dev version, there is no reason it shouldn't remain marked ready to commit.

Martin Mayer’s picture

FileSize
8.87 KB

The 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.

dazz’s picture

This 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.

heylookalive’s picture

@dazz

Using the zip file from #13, before this line:

unset($_REQUEST['destination']);

add in:

$_GET['destination'] = $form_state['redirect'];

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 to drupal_goto

// A destination in $_GET always overrides the function arguments.
// We do not allow absolute URLs to be passed via $_GET, as this can be an attack 

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!

icampana’s picture

FileSize
2.16 KB

Just 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.

guile2912’s picture

This 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

guile2912’s picture

I 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 !

Taxoman’s picture

Status: Reviewed & tested by the community » Fixed

Great! :-) So closing this and moving on with separate bug reports.

Status: Fixed » Closed (fixed)

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