[support] Why would one role be able to click collapsible fieldsets....and another role couldn't? SOLVED

Metzler, David metzlerd at evergreen.edu
Wed Oct 27 20:41:05 UTC 2010


Normally you wouldn't need this in a template file (assuming you mean
page.tpl? Or an analog?).  So the fact that these are needing to be
called explicitly is a bit disturbing.  The first time any module calls
drupal_add_js the drupal.js should be added to the theme list
automatically.  

The collapse.js is added in the form.inc include file, so it's possible
that you have a block with a form in it that adds the collapse.js when
an admin user is logged in, but the anonymous user doesn't?  Do I guess
correctly that you're trying to use the fieldset collapser outside of a
form?  If so that's the problem. 

You might consider adding the drupal_add_js('misc/collapse.js') call to
your template.php file rather than inside the template.  I think that's
a bit cleaner, but both would work. 

If I understand correctly you don't need the add of drupal.js in your
template file at all. 

Dave

-----Original Message-----
From: support-bounces at drupal.org [mailto:support-bounces at drupal.org] On
Behalf Of Neil Coghlan
Sent: Wednesday, October 27, 2010 12:19 PM
To: support at drupal.org
Subject: Re: [support] Why would one role be able to click collapsible
fieldsets....and another role couldn't? SOLVED

duh.....added this to top of template and resolved it.

<?php
   drupal_add_js('misc/collapse.js');
   drupal_add_js('misc/drupal.js');
?>

pretty dumb to have missed that!

but....why was that not necessary for the admin role?? Is it because
that javascript was already cached for that user??


On 27/10/2010 15:37, Metzler, David wrote:
> In my experience the most common cause is invalid HTML, specifically
> unclosed tags and such.  Run your page through the W3C validator to
> check.
>
> Dave
>
> -----Original Message-----
> From: support-bounces at drupal.org [mailto:support-bounces at drupal.org]
On
> Behalf Of Neil Coghlan
> Sent: Wednesday, October 27, 2010 11:01 AM
> To: support at drupal.org
> Subject: [support] Why would one role be able to click collapsible
> fieldsets....and another role couldn't?
>
> I know the answer to this is blindingly obvious but I've been very
deep
> in the drupal forest in the last few weeks and can't see any
individual
> trees anymore!
>
> High role (admin!) can see clickable link which expands a fieldset.
> Log out
> Log in as any other role - link has turned into red text, no link,
can't
> expand.
>
> is it something on the permissions page that would do this?
>
> it's not my template...I do have a couple of php conditionals wrapping
> the fieldset but it's nothing to do with roles
>
> <?php if ($node->field_team_coordinates[0]['value']) : ?>  <?php if
> ($page != 0): ?>
>
> 1. only show fieldset if field is filled out 2. only show fieldset on
> node view, not on index pages, teasers, etc.
>
> what could be un-hyperlinking the fieldset?
>
> Neil
> --
> [ Drupal support list | http://lists.drupal.org/ ]
-- 
[ Drupal support list | http://lists.drupal.org/ ]


More information about the support mailing list