Synchronising 5.x-2.x and 6.x-1.x code

Freso - May 30, 2008 - 15:55
Project:Pathauto
Version:5.x-2.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

I just went and made a diff of the two checkouts, and, taking D6 specifics into account, here's a patch for 5.x-2.x that should bring the two source tress more into sync. I've only edited out that which I was sure shouldn't be in 5.x, thus there might be more stuff we'd want to rip out.

... Actually, the patch still needs some work and I need a break, so the patch will come later.

#1

Freso - May 30, 2008 - 23:38
Status:active» needs work

This still needs a good deal more work, but I'm heading to bed now, so thought I'd post it here so other people might peek at it while I'm away for the next 2-3-4 days. Note that it probably doesn't apply in its current form. I just made a "diff -u" of the two source trees (after cat'ing pathauto.admin.inc onto the end of pathauto.module for 6.x, and have hand-edited it from there. The pathauto.module hunks seriously need to be cleaned up, and the pathauto_node.inc ones do too.

AttachmentSize
pathauto_5x_6x_sync.patch 40.49 KB

#2

Freso - May 30, 2008 - 23:40
Title:Synchronising 5.x-2.x and 6.x-1.x» Synchronising 5.x-2.x and 6.x-1.x code

#3

Freso - June 1, 2008 - 13:31
Status:needs work» needs review

Here's the first actual patch. It's not the final though. The only changes to pathauto.module so far have been to move the admin related functions to the bottom/end of the file, for easier comparison with 6.x's pathauto.admin.inc split. Also, there's a hunk in pathauto_node.inc I haven't gotten around to poking at yet.

AttachmentSize
pathauto_5x_6x_sync-264665-3.patch 33.97 KB

#4

greggles - June 1, 2008 - 20:59

The taxonomy/category stuff shouldn't be merged back to 5.x b/c that is a 6.x vs. 5.x change, right?

-      $settings['groupheader'] = t('Category path settings');
+      $settings['groupheader'] = t('Taxonomy term path settings');

#5

Freso - June 1, 2008 - 22:08

I'm honestly not sure, but I'd love to take those bits out of the patch, as that'll mean less strings to (re)translate for the 5.x-2.3 release. :) (And to think I hadn't noticed those numbers before now! Hail Eris!)

#6

Freso - June 4, 2008 - 21:18

Okay, here's a patch without the translation string changes. Greg, could you please review this? I'd really like to at least commit the pathauto.module re-arrangement before I try to work on the actual code changes between the two versions. (Oh, and I'm also rather wary about the JavaScript - I don't even know where it is used or for what, so no clue how to test it either...)

AttachmentSize
pathauto_5x_6x_sync-264665-6.patch 32.47 KB

#7

greggles - June 6, 2008 - 17:12
Status:needs review» needs work

The javascript is what disables/enables the path-alias form element on node pages and hides/shows the description underneath it. If you have "create path aliases" permission and create a node and check/uncheck the "Automatic alias" you'll see that in action. After applying the patch, the show/hide of the field description wasn't working for me, so I think we should leave that piece out.

I'm not sure about the changes to _pathauto_path_is_callback - I changed that from 5.x to 6.x due to the new menu API, but if this configuration works in both versions then that seems fine to backport it. The static variable caching is done inside of menu_get_item so we don't need to re-do that if we go this route - makes sense to me.

Other than those items, the rest of it looks good to me.

#8

Freso - June 7, 2008 - 10:59
Status:needs work» needs review

Alright. I'll be checking the attached batch in in a bit, unless someone is quick to step on and say "STOP!!!". After applying this, I'll look more into the rejected changes previously mentioned, as well as starting to work on some of the stuff I haven't messed with yet.

AttachmentSize
pathauto_5x_6x_sync-264665-8.patch 30.63 KB

#9

Freso - June 7, 2008 - 22:55
Status:needs review» needs work

Alright, batch 1 has gone in. I'll work on sync'ing pathauto.module one of the days.

#10

Freso - June 7, 2008 - 23:30

Alright, here's a new copy of the patch from #1. Hand edited about the same things out (except for some more strings changes that was decided to not include). It should be easy to see how much simpler it is now that batch 1 has gone in. :)

Also, about _pathauto_path_is_callback(). The code only checks this one place I could find (grep "_pathauto_path_is_callback" * in root dir of 5.x-2.x checkout), and only checks with if (_pathauto_path_is_callback($dst)) - ie., the actual return result isn't used for anything, it only cares whether it is or not (To be or not to be...), so I believe changing it to be like the 6.x function would work. But I haven't tested it, so...

AttachmentSize
pathauto_5x_6x_sync.patch 12.7 KB

#11

Freso - June 18, 2008 - 20:24

This one is unlikely to apply, but just putting it up here so you can see the current code that's needed to weed through.

AttachmentSize
pathauto_5x_6x_sync.new_.patch 6.15 KB

#12

Freso - June 18, 2008 - 22:08
Status:needs work» needs review

Thanks to the power of Jabber and instant messaging, Greg and I just ran over the remaining code differences, and these wee bits are what seems to be in need of sync'ing. :)

AttachmentSize
pathauto_5x_6x_sync-264665-12.patch 1.66 KB

#13

greggles - June 18, 2008 - 22:14
Status:needs review» reviewed & tested by the community

Looks awesome to me.

Thanks, Freso!

#14

Freso - June 18, 2008 - 22:18
Status:reviewed & tested by the community» fixed

That was the last to go, and it is now gone. 6.x-1.1, 'ere we come!

#15

Anonymous (not verified) - July 2, 2008 - 22:25
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.