User relationship node access not compatible with translatable 1.3.
When switching locale, e.g. from english to french the UR node access doesn't show the view and delete checkboxes anymore. In the default language (english) all 3 checkbox rows show up fine, but when switching to another language you'll only see the update checkbox.
Has anyone already encountered this issue and can point me to a fix for it.
thx

CommentFileSizeAuthor
#2 foo.txt748 bytespndur

Comments

alex.k’s picture

Sorry, no idea what this problem is. One possibility is to disable translation on that form, if you don't need it there. From the module page http://drupal.org/project/translatable :

The behavior is controlled using the form property #translatable. If it is set to FALSE, the form item value cannot be translated.

hook_form_alter in UR node access can be tweaked to add this property.

pndur’s picture

StatusFileSize
new748 bytes

@alex.k
This basically means disabling the translatable module entirely. All forms get the UR node access fieldset by default when the module is enabled, unless you remove them in a custom form (which isn't what I want to do; I have multiple content types). The UR node access fieldset is in fact a table of checkboxes having the following user interface properties:

View Update Delete

Relationship type 1 [] [] []
Relationship type 2 [] [] []
....

When switching locale to something else than the default language the checkboxes of the view and the delete column disappears, which is not what it is meant to do.

It also appears in firebug that the view and delete properties don't show up anymore when switched to another locale. So this has to be a bug in UR node access or in translatable.

I don't have the knowledge to figure this out myself.

The following is a print from firebug:
This is how it should look like: file attachment

Maybe I should crosspost this issue in project translatable too.

BTW: I encountered the same issue in UR 2.x dev, 24 april 2008 version

alex.k’s picture

@pndur I've committed a fix for this to the 5.x-2.x branch. Please check it out. I think the bug is indeed in UR as it uses action names to create the checkboxes. When an action has been translated it is looking for the form element using the translated name, whereas it never changes from {view, update, delete}. This fix should probably go into 5.x-3.x and 6.x branches, too.

pndur’s picture

@alex.k
Thx for the patch. A quick test reveals that it does its job. The switching problem seems to be fixed.

alex.k’s picture

Status: Active » Fixed

Thanks for testing this @pndur

pndur’s picture

I've found another issue. This one is related to bootstrap.inc preg_match() function. When I want to translate a node into another language i get this:
warning: preg_match() expects parameter 2 to be string, array given in XXX/includes/bootstrap.inc on line 670.

I found an issue here: http://drupal.org/node/225211 and inserted the following code:

if (!is_string($text)) {
drupal_set_message(print_r($text, true));
}

after line 666 in bootstrap.inc. This generated the following output (just a part of the output):

warning: preg_match() expects parameter 2 to be string, array given in XXX/includes/bootstrap.inc on line 670.

2
Array ( [10] => relationshiptype1 [6] => relationshiptype2 [11] => relationshiptype3 [9] => relationshiptype4 [1] => relationshiptype5 [3] => relationshiptype6 [2] => relationshiptype7 [8_yt] => relationshiptype8 (you to them) [8_ty] => relationshiptype9 (them to you) [12] => relationshiptype10 [5] => relationshiptype11 [7] => relationshiptype12 [4] => relationshiptype13 )
673
....

It's an issue I've seen multiple times without a solution.

This error appears in UR node access 2.8 as well as 2.x dev. When I disable the module the error disappears.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

alex.k’s picture

Status: Closed (fixed) » Active

re-opening since @pndur left it as fixed. Thanks @Dru-p!

pndur’s picture

The issue (#6) is still open, as I don't have the knowledge to fix it.
The only thing I can do is to test code provided by others and give feedback.

berdir’s picture

Status: Active » Closed (won't fix)

Sorry for pinging the participants.

Now that Drupal 7 is out, there is no support for Drupal 5 and the corresponding modules anymore. Therefore, I'm closing all old issues which are still open.

I suggest you upgrade to Drupal 6 or 7 and figure out if you're feature is still needed or the bug still exists and open a new issue in that case.