I am manually adding a bunch of old Blog entries. I am using Pathauto (6.x.1.x-dev, 2008-Feb-15). When I use Submit Again, Pathauto is not creating URL aliases. I do not know if this is an issue with Submit Again or Pathauto.

Comments

niklp’s picture

subscribe

lomz’s picture

Subscribing.

But could this be fixed by set the module weight of submitagain to be heavier than pathauto?

freeman-1’s picture

I'm seeing the same problem with Type_Local_NIDs module (with pathauto). I agree with lomz - after I manually set the database {system} table's Weight field for submitagain module to 99 (others typically default to 0, although Pathauto is set to 1), the problem was resolved.

The documentation is found at http://drupal.org/node/110238, which recommends to add an _install function in .install file to set this weight during installation.

Could this added in ?
Perhaps a very large number (9999?) should be used because Submitagain ultimately does the drupal_goto reload - which we should want to be the last thing to be done at nodeapi insert.

keesee’s picture

I recently ecountered this with Domain Access as the form submits access settings via a hidden form.
The work around for autopath is actually pretty simple. go to the autopath configuration page -> check generate aliases at the bottom of the node config collapsible. - hit save

This will generate aliases for nodes that you just entered using this module. As far a manually making the change in the DB, I suggest submitting a patch or you risk reverting or creating errors if upgrading later.

--
J.

keesee’s picture

I just tested the 9999 suggestion with Domain Access to no avail. I ensured that weigh on this Mod was higher than all others. AutoPath issue was solved, however I still isn't submitting the hidden form elements for Domain access.

agentrickard’s picture

Category: support » bug
Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new709 bytes

The problem is line 51 of submitagain.module. Running a drupal_goto() here stops the rest of hook_nodeapi() from firing.

The proper solution is to set a redirect on the form instead. Otherwise, all manner of errors occur, including failure to save records to the {node_access} table.

agentrickard’s picture

Status: Needs review » Needs work

The patch above is not quite right, as it will issue a redirect for any of the form buttons. You probably need to add a secondary submit handler in order to set the redirect. Another option is to set a session variable and use hook_boot() to issue the redirect based on the session var.

chrisfromredfin’s picture

Version: 6.x-1.0 » 6.x-1.1
Component: User interface » Code
Status: Needs work » Needs review
StatusFileSize
new1.34 KB

This is a patch using agentrickard's SESSION variable approach. It didn't want to work with hook_boot for some reason, but since this page shouldn't be cached we could use hook_init (and anecdotally it's working on my site).

Patch is against 6.x-1.1 of submitagain.

sjf’s picture

Status: Needs review » Reviewed & tested by the community

#8 works for me. Thanks.

moshe weitzman’s picture

You should set a submit handler on the new button, not on the whole form. That submit handler sets the redirect property of the form. no need to mess with session vars.

moshe weitzman’s picture

Status: Reviewed & tested by the community » Fixed

Just committed a different fix. Actually, it was a fumigation. Module is small and clean now. Release coming in a few mins.

Status: Fixed » Closed (fixed)

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