I am trying to specify the input format for the date field in an event content type.

I am guessing that the option to do this is to be found under 'more settings and values', however when I select this, the fieldset does not expand.

Is there something wrong with the markup?

I am using bartik and usually such links are colored blue. As can be seen from my screenshot, the link appears not to be working.

CommentFileSizeAuthor
Date input format.jpg92.81 KBmrpauldriver

Comments

Olmo’s picture

I have a similar problem. I can not change the date range. And I believe in older versions, I have been able to do this by clicking the 'more settings and values'
Oder habe ich was übersehen?

dwkitchen’s picture

Same problem here as well looking at the HTML it is:

<fieldset id="edit-instance-defaults" class="collapsible collapsed form-wrapper">
<legend>
<span class="fieldset-legend">More settings and values</span>
</legend>

and should be

<fieldset id="edit-instance-defaults" class="collapsible collapsed form-wrapper">
<legend>
<span class="fieldset-legend">
<a class="fieldset-title" href="#">More settings and values</a>
</span>
</legend>
acbramley’s picture

Getting the same issue, I've tried changing admin themes (Rubik -> Seven) with no luck. Would appreciate some love on this issue.

acbramley’s picture

Category: support » bug
Priority: Normal » Major

This is a bug, bumping priority too as it's a pretty important part of the module.

gazwal’s picture

subscribing
big bug cause the date have a "default value" (= current date) that can't be changed to "none"

acbramley’s picture

For the time being I've been getting around this problem by editing line 488 from '#collapsed' => TRUE, to '#collapsed' => FALSE, this at least allows you to edit the default values and input format until this bug gets some traction.

mrpauldriver’s picture

Ref #6

Zombienaute. Are you talking about line 488 in the date.module file?

If so, I am seeing something quite different to '#collapsed' => TRUE

acbramley’s picture

Yes I am running the 7.x-2.x-dev from 2011-09-08. Just search the file for 'more settings and values' and changed the collapsed key to FALSE under there if it's different.

mrpauldriver’s picture

thank you

karens’s picture

This is a part of the UI love that Acquia did. Maybe they can help figure it out.

jstoller’s picture

I used the workaround in #6, but then had the same problem with the "Advanced settings" fieldset, within "More settings and values". That can be forced open by modifying line 331 of date_admin.inc in a similar mannor. It aint pretty, but it seems to work for now.

karens’s picture

Status: Active » Postponed (maintainer needs more info)

I can't replicate the problem. It is likely to be either a browser issue or some other module that is interfering. Try creating a fresh install with only the date module and see if it a problem there. If not, you have some other module getting in the way. If it is still a problem there, it may be your browser and I need to know what that is.

karens’s picture

Title: Can not change input format - collapsed fieldset for 'more settings and values' will not expand » Collapsed fieldset for 'more settings and values' will not expand

Changing title slightly. Other people are seeing it but I cannot reproduce it. It works fine on a clean install so it has to either be the theme or some other module creating problems.

Mark_L6n’s picture

The problem appears to be with the value '+3'. Changing it to '3' corrects the problem for me.

Currently, Firefox gives me the error "uncaught exception: Syntax error, unrecognized expression: [value=+3]"

In file date_api/date_api_elements.inc, function date_year_range_element_process line 146, the value of $element['#value']['years_forward'] is '+3'. I added the line of code $element['#value']['years_forward'] = 3; and it started working fine.

This obviously isn't the code to fix the module, but it shows where the problem is. At whatever point the value of $element['#value']['years_forward'] is used as an integer, the leading '+' needs to be stripped off.

[edit] Using for now this line which strips the '+':
$element['#value']['years_forward'] = preg_replace( '/^\+(.+)/', '$1', $element['#value']['years_forward'] );

clemens.tolboom’s picture

I cannot reproduce #14 on Firefox.

Fieldset is collapsible on admin/structure/types/manage/my-content-type/fields/field_date_field

Theme: garland
Firefox: 8.0

karens’s picture

I am totally unable to reproduce this issue. It has to be either some other module or the browser or the theme.

For anyone having the issue, to test if it is a module issue, create a clean Drupal site with only Date module and set up one content type and a date field. You should see that it works fine. Then start adding other modules that you are using to try to see if one of them is causing a problem.

To test if it is a theme issue, switch to a core theme like Bartik and see what happens.

To test if it is a browser issue, try using a different browser.

acbramley’s picture

It must be a module because I've tried both switching admin themes and browsers, non of which fixed the issue. It's not really feasible for me to create a fresh site and enable modules to test what breaks it as I've got so many modules in this site.

Mark_L6n’s picture

I created a new installation and added all the modules I used. The problem occurs with jQuery Update.

karens’s picture

@Zombienaute, are you using jQuery Update too? If so, what version of jQuery and jQuery UI are both of you using? If we can nail that down maybe some jQuery guru can find a way to make it work across versions.

acbramley’s picture

Indeed I am using the jquery_update module. Version 7.x-2.2 which according to the info file makes jQuery version 1.5.2 and jQuery UI version 1.8.11

acbramley’s picture

Project: Date » jQuery Update
Version: 7.x-2.x-dev » 7.x-2.2

Confirmed disabling the jquery_update module fixed both the more settings and values and advanced settings fieldsets.

acbramley’s picture

Tested latest --dev version of jquery_update (which actually uses jquery 1.5.1 instead of 1.5.2) and same issue is happening.

Mark_L6n’s picture

Using this code:

drupal_add_js(
  "jQuery(document).ready(function() {
	 console.info(jQuery.fn.jquery); 
	 console.info(jQuery.ui.version); 
	   });",
  'inline'
); 

I am getting jQuery version 1.5.2, but the message 'jQuery.ui is undefined'.
Edit: Had code in wrong place. UI version is 1.8.11.

karens’s picture

Title: Collapsed fieldset for 'more settings and values' will not expand » jQuery 1.5/jQuery UI 1.8: collapsed fieldset for 'more settings and values' will not expand
Status: Postponed (maintainer needs more info) » Active

Re-naming for clarity then. I can't fix jQuery issues. Hopefully someone who knows jQuery can do it.

karens’s picture

Project: jQuery Update » Date
Version: 7.x-2.2 » 7.x-2.x-dev

Unless the collapsed fieldsets are broken everywhere, this is still a Date issue, the jQuery code used in the fieldset must need to be adapted to work in a later version of jQuery.

Mark_L6n’s picture

Yes, looking at #14, this might be a Date issue--the newer jQuery might just be rejecting a string when an integer is expected.
I tried following the code, but don't understand yet well enough how Drupal works to see what happens after date_api_elements.inc, function _date_api_element_info().

clemens.tolboom’s picture

I know jquery but please update the issue summary with a 'steps to reproduce' :-)

I will follow-up on those steps then.

Mark_L6n’s picture

Steps to reproduce:

1) Enable jQuery update module.
2) Create a new content type, and add a Date field to it.
3) Edit the Date field. 'SHOW MORE SETTINGS AND VALUES' should function as a link to expand the fieldset. However, it just acts like plain text.

The line in the HTML causing the problem is:
<input class="select-list-with-custom-option forward form-text" type="text" id="edit-instance-widget-settings-year-range-years-forward" name="instance[widget][settings][year_range][years_forward]" value="+3" size="10" maxlength="128" />
Changing '+3' to '3' allows it to function correctly.

clemens.tolboom’s picture

Error is cause by

file: date_year_range.js
line :146
code:  var possible = $dropdown.find('option[value=' + textfieldValue + ']');

Easy fix is adding double quotes
var possible = $dropdown.find('option[value="' + textfieldValue + '"]');

Trying to diff against date.git file seemed this is fixed in #1239934: Reuse the "years back and forward" dropdown widget on the Views filter settings page 3 days ago. Yikes

git log date_year_range.js
commit ae1915b0d0bdebe43db9c3445fa277fdea47a214
Author: Karen Stevenson
Date: Tue Nov 15 09:09:24 2011 -0600

Issue #1239934 by casey, Fix javascript exception in date_year_range.js.

clemens.tolboom’s picture

Status: Active » Fixed

@Mark123 thanks for the steps :)

We can consider this issue now fixed.

Status: Fixed » Closed (fixed)

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