Suppression of URL_ALIAS bugged in node translations.

pmingard - September 11, 2009 - 09:03
Project:Path
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi,

I don't know if this bug have already been raised, my apologise if already done.

Description of the bug

DRUPAL VERSION : 6.13
INSTALLED MODULES : TinyMCE, Webforms, Path, CAPTCHA, Internationalization, Content type translations, Block translations, Menu translations, Synchronize translations, String translations, Taxonomy translations, Translations overview

1) create a node in main language with a URL_ALIAS, let's say cms/home
2) create a translation of the node in a secondary language with a URL_ALIAS, let's say the same cms/home
3) delete the node of the translations

You can see in the list of the URL_ALIAS that the alias of the translation node has not been deleted. If you try then to add a new translation of the node with the same alias, you'll get an error message saying it is already reserved.

Suggested correction

FILE : drupal\modules\path\path.module
Search :

      case 'delete':
        $path = 'node/'. $node->nid;
        if (drupal_get_path_alias($path) != $path) {
          path_set_alias($path);
        }
        break;

Replace by :

      case 'delete':
        $path = 'node/'. $node->nid;
        if (drupal_get_path_alias($path, $language) != $path) {
          path_set_alias($path);
        }
        break;

This fix the problem with my version. Did not check for any side effect. Hope this will help other people than me that have same error.

Patrick Mingard, Switzerland

 
 

Drupal is a registered trademark of Dries Buytaert.