Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm getting a "button is undefined" Javascript error when loading a form where i'm not allowed to post image fields.
It seems that the upload.js is being loaded without matter that the module is setting the form access attribute for the field to FALSE.
Comments
Comment #1
paradigmshifter CreditAttribution: paradigmshifter commentedI believe I'm experiencing this same problem. In IE it is stops the rest of my javascript from completing and leaves the users without FCKEditor.
Comment #2
paradigmshifter CreditAttribution: paradigmshifter commentedDoes anyone know of a solution to this problem? Or can possibly point me in the right direction to solve it. Thanks
Comment #3
TaPes CreditAttribution: TaPes commentedi have the same problem, does anyone have a solution?
Comment #4
wflorian CreditAttribution: wflorian commentedSame problem here!! I changed priority to critical because it makes the module useless to me, because other modules are not working when cck field permissions is turned on for image fields.
Nobody here who has a solution??
Please contact me, I am willing to honor working solutions with little extra money! ;)
Comment #5
wflorian CreditAttribution: wflorian commentedI did have some further research on this, because I really need to get this module working.
There is a module called Workflow Fields, which does not exactly do what CCK Field Permissions can do, but it can also make certain cck fields invisible.
If an image field is set invisible there is also an JS error, BECAUSE the javascript settings of the upload part of the form are not removed. This is critical because the collapsible fieldsets in the form stop working and stay collapsed. (http://drupal.org/node/238525)
They posted a patch which looks like that:
SO we would really need a patch like that. Actually I am no PHP pro, so I would appreciate if someone with some knowledge in that can help us out here!
Like I said, I am willing to support your help with a little extra money. Please contact me.
Comment #6
wflorian CreditAttribution: wflorian commentedThanks tu ufku (http://drupal.org/user/9910) I got a working patch:
change
$form[$disallowed_field]['#access'] = false;
to
$form[$disallowed_field]['#access'] = false; if (isset($form[$disallowed_field .'-attach-url'])) {
$form[$disallowed_field .'-attach-url']['#access'] = false; }
and change
unset($form[$name]);
to
unset($form[$name]);
if (isset($form[$name .'-attach-url'])) {
$form[$name .'-attach-url']['#access'] = false; }
Comment #7
pcorbett CreditAttribution: pcorbett commented#6 was a little off as of the most recent 5.x-1.x-dev. The basic concept is correct, but I found that the code had changed around a bit since then, so to get this working I added it around line 253 of cck_field_perms.module:
I'm not sure the unset() is necessary or not, but submitting the page works alright so far. AND, my TinyMCE is back, so my client is happy :)
Comment #8
behindthepage CreditAttribution: behindthepage commentedFor version 5.x-1.10 insert code after line 183 in function _cfp_form_helper
Comment #9
plan9 CreditAttribution: plan9 commentedCode in number #7 worked better for me. #8 caused ajax form uploads (via upload image module) to flake out.