Hello,
I point this here as it seems to be the best place to warn people, even if the bug is more on the strongarm side...

If you have both modules (Autosave and Strongarm) enabled, Autosave will behave erroneously : it will save the node each time it wants to save your progression. Which can lead to a lot of consequences. For example, in my case : every 15 seconds, my node was saved as is (even the "post to twitter" checkbox), and posted on twitter.
This produced many many posts on Twitter (and also many, many nodes), linking to my preproduction site ( :-( ).

Well, I don't have any solution to this problem, other than disabling one module or the other.
For those who want to have a look at it, I suggest you start with Strongarm's hook_init (which calls drupal_init_path() ).

Regards,

David

Comments

aaronbauman’s picture

aaronbauman’s picture

Following up on David's assessment:
strongarm_init overrides $_GET['q'], which is used by drupal core to determine which menu handler to invoke.

Since 'q' was set in the autosave's ajax POST, strongarm assigns $_GET['q'] to the node form's URL. Therefore, the menu system hands the request to node.module instead of autosave's menu handler.

There are two possible solutions:
1. change autosave's ajax POST to not use the special "q" variable
2. change strongarm_init to not override $_GET['q']

aaronbauman’s picture

Not sure where is the best place to document this, so I cross-posted this issue to Strongarm issue queue.

#855338: Overriding $_GET['q'] in strongarm_init causes problems when $_POST['q'] is set

aaronbauman’s picture

Here's where 'q' gets set in the post array
from line 73 of autosave.js:

  serialized['q'] =  Drupal.settings.autosave.q;

the variable "serialized" gets passed to $.ajax as the POST data.

aaronbauman’s picture

Status: Active » Needs review
StatusFileSize
new1.57 KB

I *think* this patch would resolve this issue (untested), however I tend to agree with liquidcms that the bug is actually in Strongarm.

galaxor’s picture

Version: 6.x-2.7 » 6.x-2.9
Status: Needs review » Reviewed & tested by the community

Here is the patch made against autosave 2.9. I actually didn't notice this bug, so I re-created this patch myself, from first principles (in #1362858: Does not work when strongarm is present). When I compared it with yours, I discovered that it was basically identical, except that I had called the variable autosave_q instead of autosave_path.

My point is, since I came to exactly the same conclusion as you, and it worked for me, I'm going to call this RTBC.

Crell’s picture

Status: Reviewed & tested by the community » Needs work

There is no patch on #6.

I am also not giving the D6 version of autosave much attention, as I never worked on it and have no Drupal 6 sites that use it... or that I'm even maintaining at this point. :-) My life is all Drupal 7.

quicksketch’s picture

Title: WARNING! : Incompatibility with Strongarm ! » Incompatibility with Strongarm module
Priority: Critical » Major
Status: Needs work » Fixed
StatusFileSize
new0 bytes

Thanks guys, the code changed slightly and required that a change be made to the autosave_save_access() function also, but after updating that last instance of $_POST['q'], everything worked great.

quicksketch’s picture

StatusFileSize
new2.79 KB

Here's the correct patch.

Status: Fixed » Closed (fixed)

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