Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1111935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:37:42+00:00 2026-05-17T02:37:42+00:00

I really don’t get why this is not working. I want to avoid a

  • 0

I really don’t get why this is not working. I want to avoid a specific form item being collapsed.

This is my element I want to modify (after the change with the code below):

 [taxonomy] => Array
        (
            [tags] => Array
                (
                    [1] => Array
                        (
                            [#type] => textfield
                            [#title] => Tags
                            [#description] => A comma-separated list of terms describing this content. Example: funny, bungee jumping, "Company, Inc.".
                            [#required] => 0
                            [#default_value] => 
                            [#autocomplete_path] => taxonomy/autocomplete/1
                            [#weight] => 0
                            [#maxlength] => 1024
                            [#collapsed] => 0
                            [#collapsible] => 0
                        )

                    [#collapsed] => 0
                    [#collapsible] => 0
                )

            [#weight] => -3
            [#tree] => 1
            [#collapsed] => 0
            [#collapsible] => 0

This is my code in hook_form_alter (I’m sure the form is modified by the code):

 $form['taxonomy']['#collapsed'] = 0;
 $form['taxonomy']['tags']['#collapsed'] = 0;
 $form['taxonomy']['tags'][2]['#collapsed'] = 0;

 $form['taxonomy']['#collapsible'] = 0;
 $form['taxonomy']['tags']['#collapsible'] = 0;
 $form['taxonomy']['tags'][3]['#collapsible'] = 0;

But it doesn’t work. The element is always collapsed. And I’ve refreshed all caches
alt text

http://dl.dropbox.com/u/72686/tagsform.txt

Update2:

$form['taxonomy']['#required'] = TRUE;
$form['taxonomy']['tags']['#required'] = TRUE;
$form['taxonomy']['tags'][5]['#required'] = TRUE;

alt text

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T02:37:42+00:00Added an answer on May 17, 2026 at 2:37 am

    From the array you posted, it looks like you try to adjust the form element before taxonomy module actually turned it into a fieldset (note that there is no '#type' => 'fieldset' declaration in that array). If you take look at taxonomy_form_alter(), you can see that it is in that hook_form_alter() implementation, that the taxonomy array in the node gets ‘converted’ into actual forms API elements.

    So my guess is that your adjustments reside in a hook_form_alter() implementation that runs before that of the taxonomy module, so that your declarations for the collapsed states get overwritten by taxonomy module immediately after you set them.

    Try to adjust your modules weight to something higher than that of taxonomy module and see if this changes things. (Be aware that changing the weight might effect other things that your module does, so test carefully after doing it!)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is coded in pseudo-PHP, but I really don't mind what language I
I don't really get lambda expressions. While they've been around since the days of
I don't really get it and it's driving me nuts. i've these 4 lines:
I really don't like the VS2008 Start Page. I don't need the RSS reader,
I really don't understand the fascination with XHTML strict. Inline JavaScript typically requires a
I really don't know how to describe it, but if you understood it and
I am re-designing an application for a ASP.NET CMS that I really don't like.
I've just installed Resharper, and I really don't know how to use it correctly.
I have the following markup for buttons (can be changed, but I really don't
I don't really FEEL CSS and it doesn't always work as I think it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.