Does not work with images (and other fields)

lenart - September 11, 2006 - 13:25
Project:Add and Reference
Version:HEAD
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Add and reference module will not work with image node type (and some other types). I had a quick look at the code and saw that the problem is in line 74

<?php
   
if (!empty($value) && user_access("create $child_type content")) {
?>

It chechs for user's permissions and since permissions for images are not set as "create image content" but "create images" this code will not work.

I made a quickfix but this is definitely not a long-term solution since other content-types might also have different names for access permissions.

<?php
   
if (!empty($value) && (user_access("create $child_type content") || user_access("create $child_type" . "s"))) {
?>

P.S. I hope I was clear enough with my lousy english.

 
 

Drupal is a registered trademark of Dries Buytaert.