pathauto_admin_delete_submit() uses return instead of $form_state['redirect']

Freso - May 8, 2008 - 18:14
Project:Pathauto
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

See Submit handlers use $form_state rather than returning urls.

Caught by the awesome Coder module. :)

AttachmentSize
pathauto_5x_to_6x.patch562 bytes

#1

Freso - May 8, 2008 - 18:33

Greggles caught a little tricky thing - $node isn't defined in the function! So I went to look at how core handled _submit functions, and they didn't set the nid key. (See #256289: Superfluous example code in 5.x to 6.x FormAPI guide.)

Re-rolled with just redirect set.

AttachmentSize
pathauto_5x_to_6x.patch526 bytes

#2

Freso - May 11, 2008 - 09:45

I tried playing around with bulk deletion of aliases, and the behaviour seemed to be the same with and without the patch... the patch makes Coder not bark on this bit of the code though, and is better Drupal 6 code anyway.

#3

samirnassar - May 11, 2008 - 17:24
Title:pathauto_admin_delete_submit() uses return instead of $form_state['redirect']» Patch against 6.x-1.0

Freso's patch is against D5, this patch is against D6. Works as advertised.

Edit: Patch removed.

#4

Freso - May 11, 2008 - 17:04
Title:Patch against 6.x-1.0» pathauto_admin_delete_submit() uses return instead of $form_state['redirect']

I'm sorry to disappoint, but my patch was (and still is) against the 6.x branch. The easy way to tell? It's patching pathauto.admin.inc which doesn't exist in <6.x-1.x-dev (including 6.x-1.0, for the record). Your patch on the other hand is patching pathauto.module... so it's actually you who is either patching against 5.x or an old version of the 6.x code.

#5

samirnassar - May 11, 2008 - 17:23

I see. From the name of the patch it sounded like it was patching against D5. The lack of the file in 6.x-1.0 then lead me to believe that pathauto.admin.inc was an artifact of the 5.x branch of pathauto.

Either way the code modifications you made work, whether in 6.x-1.x-dev or 6.x-1.0

My apologies for the confusion.

#6

samirnassar - May 11, 2008 - 17:35

I think this could be RTBC'd. I applied the patch then mass deleted my categories and that worked.

#7

Freso - May 11, 2008 - 17:41
Status:patch (code needs review)» patch (reviewed & tested by the community)

Yeah. I'm just waiting for Greg to poke his hand out for a thumbs up and I'll commit it.

And no worries. :) The reason I named the patch as I did was since it finishes the 5.x to 6.x port. This is the last remnant of 5.x code (that I could find) which needed converting to 6.x code.

#8

greggles - May 11, 2008 - 22:56

Definitely - the updated version looks great to me.

#9

Freso - May 12, 2008 - 07:41
Status:patch (reviewed & tested by the community)» fixed

Committed! :)

#10

Anonymous (not verified) - May 26, 2008 - 07:41
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.