Pathauto (or just core Path module) conflicts with project*

aclight - July 18, 2008 - 11:23
Project:Pathauto
Version:5.x-2.3
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi all

I was hoping that one of the pathauto maintainers could take a look at an issue in the project queue, #283779: problem with sorting after editing project release - urgent. The problem reported there is one that we've known about for a while in some form, and it all comes back to #98278: project* namespace bugs in $node.

The gist of the problem is that project, project release, project issue, and many other modules all set properties of $node such as pid, sid, rid, etc. and sometimes two modules try to set the same property on the same $node object, and problems result. I wouldn't say that project* is any more or less at fault than another module that does the same thing, but I do want to bring this problem to your attention in case you're not aware of it.

In the first thread I mention, the user reports a conflict between pathauto and project release. I am not a user of pathauto, and so I'm not sure if there's an easy way around the problem. Perhaps the user could disable pathauto just for project and project release nodes, if that's possible.

I was also wondering how difficult this would be for you to fix in pathauto? Our intent in project* is to eventually rewrite project* so that instead of using $node->pid, etc. it would use $node->project['pid'], etc. This way the node namespace should be protected and problems shouldn't happen. But, patches have not been completed, and the problem is fairly widespread in project* so it's not that simple of a patch. Perhaps it would be easy to fix in pathauto? If so, that would be one less module that project* conflicts with, and pathauto seems to be a very popular module that a lot of people running project* use.

At the very least I think it would be a good idea to add a note to the front page of your project mentioning the conflict. We should probably add one to the project and project issue pages as well, though in that case it's a little more difficult because we don't have a list of all conflicting modules.

Thanks for your time

#1

greggles - July 18, 2008 - 15:52
Title:Pathauto conflicts with project*» Pathauto (or just core Path module) conflicts with project*

Here is a node object that I'm editing and submitting. To view the contents I tried priting it out in the pathauto_nodeapi (has a weight of 10, so it runs pretty late) and in meez_api (weight of 0, m is in the middle of the alphabet...)

pathauto_nodeapi(op == update)
Pathauto enabled

stdClass Object
(
    [nid] => 38
    [vid] => 61
    [type] => page
    [status] => 1
    [created] => 1211043939
    [changed] => 1216395609
    [comment] => 0
    [promote] => 0
    [sticky] => 0
    [revision_timestamp] => 1211045703
    [title] => a title before with a stuff
    [body] =>
    [teaser] =>
    [log] =>
    [format] => 1
    [uid] => 1
    [name] => greg
    [picture] =>
    [data] => a:1:{s:7:"avatars";a:5:{s:7:"head_sm";O:8:"stdClass":6:{s:8:"viewname";s:8:"headshot";s:11:"imageformat";s:3:"JPG";s:5:"width";s:2:"48";s:6:"height";s:2:"48";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341593.jpg
";s:3:"alt";s:6:"avatar";}s:7:"head_lg";O:8:"stdClass":6:{s:8:"viewname";s:8:"headshot";s:11:"imageformat";s:3:"JPG";s:5:"width";s:3:"100";s:6:"height";s:3:"100";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341594.jpg
";s:3:"alt";s:6:"avatar";}s:7:"body_sm";O:8:"stdClass":6:{s:8:"viewname";s:8:"bodyshot";s:11:"imageformat";s:3:"JPG";s:5:"width";s:3:"175";s:6:"height";s:3:"260";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341596.jpg
";s:3:"alt";s:6:"avatar";}s:7:"body_lg";O:8:"stdClass":6:{s:8:"viewname";s:8:"bodyshot";s:11:"imageformat";s:3:"JPG";s:5:"width";s:3:"300";s:6:"height";s:3:"400";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341597.jpg
";s:3:"alt";s:6:"avatar";}s:4:"anim";O:8:"stdClass":6:{s:8:"viewname";s:8:"bodyshot";s:11:"imageformat";s:4:"AGIF";s:5:"width";s:3:"300";s:6:"height";s:3:"400";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341598.gif
";s:3:"alt";s:6:"avatar";}}}
    [last_comment_timestamp] => 1211043956
    [last_comment_name] =>
    [comment_count] => 0
    [taxonomy] => Array
        (
            [4] => Array
                (
                    [6] => 6
                )

        )

    [date] => 2008-05-17 17:05:39 +0000
    [revision] => 0
    [subscriptions_notify] => 1
    [preview] => Preview
    [op] => Submit
    [submit] => Submit
    [delete] => Delete
    [form_token] => c44b527aaa4180c0fd260a3d2624be6c
    [form_id] => page_node_form
    [menu] => Array
        (
            [title] =>
            [description] =>
            [pid] => 1
            [path] =>
            [weight] => 0
            [mid] => 0
            [type] => 86
        )

    [path] =>
    [pathauto_perform_alias] => 1
    [validated] => 1
    [is_new] =>
)

And here it is:
meez_nodeapi(op== update)
Pathauto enabled

stdClass Object
(
    [nid] => 38
    [vid] => 61
    [type] => page
    [status] => 1
    [created] => 1211043939
    [changed] => 1216395832
    [comment] => 0
    [promote] => 0
    [sticky] => 0
    [revision_timestamp] => 1216395746
    [title] => a title before with a stuff
    [body] =>
    [teaser] =>
    [log] =>
    [format] => 1
    [uid] => 1
    [name] => greg
    [picture] =>
    [data] => a:1:{s:7:"avatars";a:5:{s:7:"head_sm";O:8:"stdClass":6:{s:8:"viewname";s:8:"headshot";s:11:"imageformat";s:3:"JPG";s:5:"width";s:2:"48";s:6:"height";s:2:"48";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341593.jpg
";s:3:"alt";s:6:"avatar";}s:7:"head_lg";O:8:"stdClass":6:{s:8:"viewname";s:8:"headshot";s:11:"imageformat";s:3:"JPG";s:5:"width";s:3:"100";s:6:"height";s:3:"100";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341594.jpg
";s:3:"alt";s:6:"avatar";}s:7:"body_sm";O:8:"stdClass":6:{s:8:"viewname";s:8:"bodyshot";s:11:"imageformat";s:3:"JPG";s:5:"width";s:3:"175";s:6:"height";s:3:"260";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341596.jpg
";s:3:"alt";s:6:"avatar";}s:7:"body_lg";O:8:"stdClass":6:{s:8:"viewname";s:8:"bodyshot";s:11:"imageformat";s:3:"JPG";s:5:"width";s:3:"300";s:6:"height";s:3:"400";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341597.jpg
";s:3:"alt";s:6:"avatar";}s:4:"anim";O:8:"stdClass":6:{s:8:"viewname";s:8:"bodyshot";s:11:"imageformat";s:4:"AGIF";s:5:"width";s:3:"300";s:6:"height";s:3:"400";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341598.gif
";s:3:"alt";s:6:"avatar";}}}
    [path] => title-before
    [last_comment_timestamp] => 1211043956
    [last_comment_name] =>
    [comment_count] => 0
    [taxonomy] => Array
        (
            [4] => Array
                (
                    [6] => 6
                )

        )

    [date] => 2008-05-17 17:05:39 +0000
    [revision] => 0
    [subscriptions_notify] => 1
    [preview] => Preview
    [op] => Submit
    [submit] => Submit
    [delete] => Delete
    [form_token] => c44b527aaa4180c0fd260a3d2624be6c
    [form_id] => page_node_form
    [menu] => Array
        (
            [title] =>
            [description] =>
            [pid] => 1
            [path] =>
            [weight] => 0
            [mid] => 0
            [type] => 86
        )

    [pid] => 280
    [pathauto_perform_alias] => 1
    [validated] => 1
    [is_new] =>
)

And here it is:
meez_nodeapi(op== update)
Pathauto disabled

stdClass Object
(
    [nid] => 38
    [vid] => 61
    [type] => page
    [status] => 1
    [created] => 1211043939
    [changed] => 1216395746
    [comment] => 0
    [promote] => 0
    [sticky] => 0
    [revision_timestamp] => 1216395609
    [title] => a title before with a stuff
    [body] =>
    [teaser] =>
    [log] =>
    [format] => 1
    [uid] => 1
    [name] => greg
    [picture] =>
    [data] => a:1:{s:7:"avatars";a:5:{s:7:"head_sm";O:8:"stdClass":6:{s:8:"viewname";s:8:"headshot";s:11:"imageformat";s:3:"JPG";s:5:"width";s:2:"48";s:6:"height";s:2:"48";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341593.jpg
";s:3:"alt";s:6:"avatar";}s:7:"head_lg";O:8:"stdClass":6:{s:8:"viewname";s:8:"headshot";s:11:"imageformat";s:3:"JPG";s:5:"width";s:3:"100";s:6:"height";s:3:"100";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341594.jpg
";s:3:"alt";s:6:"avatar";}s:7:"body_sm";O:8:"stdClass":6:{s:8:"viewname";s:8:"bodyshot";s:11:"imageformat";s:3:"JPG";s:5:"width";s:3:"175";s:6:"height";s:3:"260";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341596.jpg
";s:3:"alt";s:6:"avatar";}s:7:"body_lg";O:8:"stdClass":6:{s:8:"viewname";s:8:"bodyshot";s:11:"imageformat";s:3:"JPG";s:5:"width";s:3:"300";s:6:"height";s:3:"400";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341597.jpg
";s:3:"alt";s:6:"avatar";}s:4:"anim";O:8:"stdClass":6:{s:8:"viewname";s:8:"bodyshot";s:11:"imageformat";s:4:"AGIF";s:5:"width";s:3:"300";s:6:"height";s:3:"400";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341598.gif
";s:3:"alt";s:6:"avatar";}}}
    [path] => title-before
    [last_comment_timestamp] => 1211043956
    [last_comment_name] =>
    [comment_count] => 0
    [taxonomy] => Array
        (
            [4] => Array
                (
                    [6] => 6
                )

        )

    [date] => 2008-05-17 17:05:39 +0000
    [revision] => 0
    [subscriptions_notify] => 1
    [preview] => Preview
    [op] => Submit
    [submit] => Submit
    [delete] => Delete
    [form_token] => c44b527aaa4180c0fd260a3d2624be6c
    [form_id] => page_node_form
    [menu] => Array
        (
            [title] =>
            [description] =>
            [pid] => 1
            [path] =>
            [weight] => 0
            [mid] => 0
            [type] => 86
        )

    [pid] => 278
    [validated] => 1
    [is_new] =>
)

And...meez_nodeapi(op == update)
With pathauto and path disabled

stdClass Object
(
    [nid] => 38
    [vid] => 61
    [type] => page
    [status] => 1
    [created] => 1211043939
    [changed] => 1216396234
    [comment] => 0
    [promote] => 0
    [sticky] => 0
    [revision_timestamp] => 1216395832
    [title] => a title before with a stuff
    [body] =>
    [teaser] =>
    [log] =>
    [format] => 1
    [uid] => 1
    [name] => greg
    [picture] =>
    [data] => a:1:{s:7:"avatars";a:5:{s:7:"head_sm";O:8:"stdClass":6:{s:8:"viewname";s:8:"headshot";s:11:"imageformat";s:3:"JPG";s:5:"width";s:2:"48";s:6:"height";s:2:"48";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341593.jpg
";s:3:"alt";s:6:"avatar";}s:7:"head_lg";O:8:"stdClass":6:{s:8:"viewname";s:8:"headshot";s:11:"imageformat";s:3:"JPG";s:5:"width";s:3:"100";s:6:"height";s:3:"100";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341594.jpg
";s:3:"alt";s:6:"avatar";}s:7:"body_sm";O:8:"stdClass":6:{s:8:"viewname";s:8:"bodyshot";s:11:"imageformat";s:3:"JPG";s:5:"width";s:3:"175";s:6:"height";s:3:"260";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341596.jpg
";s:3:"alt";s:6:"avatar";}s:7:"body_lg";O:8:"stdClass":6:{s:8:"viewname";s:8:"bodyshot";s:11:"imageformat";s:3:"JPG";s:5:"width";s:3:"300";s:6:"height";s:3:"400";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341597.jpg
";s:3:"alt";s:6:"avatar";}s:4:"anim";O:8:"stdClass":6:{s:8:"viewname";s:8:"bodyshot";s:11:"imageformat";s:4:"AGIF";s:5:"width";s:3:"300";s:6:"height";s:3:"400";s:3:"src";s:63:"
http://images.meez.com/user03/04/06/10/040610_10001341598.gif
";s:3:"alt";s:6:"avatar";}}}
    [last_comment_timestamp] => 1211043956
    [last_comment_name] =>
    [comment_count] => 0
    [taxonomy] => Array
        (
            [4] => Array
                (
                    [6] => 6
                )

        )

    [date] => 2008-05-17 17:05:39 +0000
    [revision] => 0
    [subscriptions_notify] => 1
    [preview] => Preview
    [op] => Submit
    [submit] => Submit
    [delete] => Delete
    [form_token] => c44b527aaa4180c0fd260a3d2624be6c
    [form_id] => page_node_form
    [menu] => Array
        (
            [title] =>
            [description] =>
            [pid] => 1
            [path] =>
            [weight] => 0
            [mid] => 0
            [type] => 86
        )

    [validated] => 1
    [is_new] =>
)

The only place that Pathauto adds stuff to the $node object is in pathauto_form_alter in pathauto.module where it adds       $form['path']['pathauto_perform_alias'] = array( That should be safe from the project* namespace, right?

However, the core path module (required by pathauto, of course) does use a pid.

Pathauto also does some tricky JS work during node editing to disable the path field, which could somehow be inter-related.

#2

aclight - July 18, 2008 - 16:22
Status:active» fixed

Ah...I wasn't actually aware that pathauto used the core path module, though that makes perfect sense. I know we've had reports of conflicts with just the core path module as well, so that must be the source of the problem for people using pathauto. Thanks for clarifying.

#3

greggles - July 18, 2008 - 17:04

no problem - I updated http://drupal.org/node/193635 to make the conflict a little more clear.

#4

watbe - July 18, 2008 - 23:08

On my installation, project* seems to work fine with the core path module, but conflicts with pathauto... I don't know how this can help but I could probably give some more information if you need it.

#5

greggles - July 18, 2008 - 23:15

Hmmm - OK. Can you be a little more clear? If you try to set a path for a project_issue using the path module does that cause problems or does it work as expected?

@aclight - feel free to re-open if you want me to investigate more. Also, I reverted to your last good copy of http://drupal.org/node/193635

#6

watbe - July 18, 2008 - 23:19

It works as expected as shown http://crycity.wonderingfish.com/testetsets1

#7

aclight - July 18, 2008 - 23:55

@greggles: I'm not sure about project issue, but the project module uses the core path module to set the paths for projects to be /project/project_uri instead of /node/nid. I'm not sure if this information is relevant or not.

#8

Anonymous (not verified) - August 1, 2008 - 23:55
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.