A bit of an odd situation --

When a node with a taxonomy term has an imagefield for uploading images, and I upload an image, I get a modal window popup while the upload is in progress with the error message in this issue's title.

A quick fix is to comment out lines 401 and 402 on pathauto.module, but from the looks of that, I'm sacrificing sanitization of the uploaded files:

  $catpath = pathauto_cleanstring(check_plain(preg_replace('/\//', '', $parent->name))) .'/'. $catpath;
  $catpath_raw = pathauto_cleanstring(preg_replace('/\//', '', $parent->name)) .'/'. $catpath_raw;

The error only occurs when the node has a taxonomy term assigned to it. It's also worth noting that this only appears to occur when re-editing a node. If I create a node, assigning a term and uploading images at the same time, it doesn't.

CommentFileSizeAuthor
#2 include_for_sure_194669.patch1.23 KBgreggles

Comments

bsuttis’s picture

Commenting the above out is not helpful when using [catpath] or [catpath-raw] for taxonomy terms, so it's of no use in terms of a fix unless you don't alias your terms.

greggles’s picture

Status: Active » Needs review
StatusFileSize
new1.23 KB

This seems kind of hard to repeat so I'm hoping that you can test out this patch. Basically it adds a call to _pathauto_include to the pathauto_token_values function so that we are sure to have access to the pathauto_cleanstring function when we need it.

bsuttis’s picture

Status: Needs review » Fixed

From the tests I did in 2 environments with the problem (5.1 production site and fresh install of 5.3 with limited modules), the patch above has fixed the problem.

Thanks much.

greggles’s picture

Status: Fixed » Reviewed & tested by the community

Great, then it's ready to be committed (not yet fixed since it hasn't be committed yet...)

greggles’s picture

Status: Reviewed & tested by the community » Fixed

And now it's been committed to drupal-5--2 and trunk.

Thanks for the testing, bsuttis!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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