acidfree submit not compatible with path.module (urldecode() error)

fallacious - April 19, 2006 - 16:23
Project:Acidfree Albums
Version:4.7.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Submitting from the "album contents" pages (and perhaps from other places, too) triggers the following log message:

urldecode() expects parameter 1 to be string, array given in /.../modules/path.module on line 149.

#1

vhmauery - April 20, 2006 - 13:42

I cannot reproduce this. Can you give me more information? Are you using the most recent version?

#2

fallacious - April 20, 2006 - 15:24
Status:active» closed

I updated both filemanager and acidfree, then ran update.php.

All better now. Oops, and thanks.

#3

fallacious - April 21, 2006 - 00:18
Status:closed» active

My apologies, I spoke too soon.

Filemanager and Acidfree are at the most recent version. The log message is triggered when changing the category from the album view or probably by submitting any change at all. In case it matters, I use the friendselectric theme and also run the taxonomy_access module.

There's one of these message per item on the album view.

I wonder if this is a bug in the drupal core, though. I note that in the album view, I see the headings for Comment settings and so on, but the headings are not expandable. Anyway, the path module seems unhappy with whatever it's getting fed.

#4

wpd - April 25, 2006 - 01:32

I can confirm this error. I get it submitting "album contents". The number of images and error messages are equal.

The final url looks like this:

node/63/contents%26page%3D0

I am using the latest from CVS for Drupal and acidfree. (I just updated everything to make sure.)
PHP 4.3.10

#5

wpd - April 25, 2006 - 02:04

On my test site that runs on my local machine I do not have this problem with PHP 5.

#6

wpd - April 25, 2006 - 02:42
Title:urldecode() logged error» acidfree submit not compatible with path.module (urldecode() error)

Sorry for all the posts. Here is some more information:
-The problem is related to the path module being enabled. The acidfree album does not have to an alias.
(i.e. photos -> node/16)
-This is true for PHP5 or PHP4. (Forget the last post ;))
-Everytime I move a photo to a different album an empty alias is created. It points the node (node/25) to ''.

For some reason, the $node->path is set to Array when you move a photo. This causes the path.module to add a new path alias and create warning message.

#7

wpd - April 27, 2006 - 03:19

When you install the devel module, the urldecode error goes away. However, the bad path alias is still created.
This problem does not occur during a normal edit of the node. It is particular to the 'album contents' functionality.

#8

wpd - April 29, 2006 - 01:23

I found the problem, but I do not know how to fix it. acidfree_album_contents creates a form that allows you to edit/move any item in the album. In doing this, multiple calls to node_load are called. This function in turn calls hook_nodeapi. hook_nodeapi is called for the path module. The path module alters the form to add the path specific fields.

When saving the information, the node was getting populated with all fields from the form. The problem is several of these fields are arrays because of the way the form is created. The path field is what is causing this bug, but I wonder if it may cause problems later with other hook_nodeapi .

# title->Training
# body->Training
# small->
# large->
# thumb->0
# class->album
# parent->16
# weight->0
# checked->0
# nid->20
# menu->Array
# path->Array
# attachments->Array
# ptype->
# og_nodeapi->Array

#9

wpd - May 3, 2006 - 02:17
Status:active» needs review

I asked on the development mailing list and there was not a consensus on how to fix this, so I picked my own.
In acidfree_album_contents_submit, I prune the form so that the 'uninitialzed' values are not sent to node_save.
This fixes the problem for me. If a node already has a path assigned, it still works.

AttachmentSize
acidfree.patch_0.txt 1.21 KB

#10

wpd - May 19, 2006 - 15:20

Is anyone else experiencing this?

#11

geofs - May 30, 2006 - 08:14

I do have the same problem. I can't provide more info but your patch works. at least the warning disappear. thanks.

#12

wpd - May 31, 2006 - 13:01
Status:needs review» reviewed & tested by the community

changing status based on previous review

#13

mkoby - July 3, 2006 - 00:21

I'm running the CVS version of acidfree and filemanager, and I'm still getting this error. Are there any compatability issues with certain modules?

I'm also running drupal 4.7.2. So that might be it as well.

#14

vhmauery - July 3, 2006 - 14:05
Status:reviewed & tested by the community» fixed

A fix for this bug has been committed to CVS. It should appear in the tarball packages within 12 hours or so.

#15

vhmauery - July 4, 2006 - 13:04
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.