Follow-up from #2145081: Duplicate id #rooms-wrapper.

If you have a case where you need different availability searches on a page, as soon as you embed more than one, the date pickers start to act funky.

This is because we have hardcoded the datepicker ids into the javascript.

We need to refactor this to pass a unique datepicker ajax id for each set of pickers to the javascript via eg, a Drupal.settings.rooms.datepickers parameter.

This would also allow us to refactor the duplicate code in /js/rooms_date_popup.js and /modules/rooms_availability/rooms_availability_date_popup.js (which also collides if they were both to ever be added to the same page).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jwilson3’s picture

Status: Reviewed & tested by the community » Active
jwilson3’s picture

Title: Refactor datepicker js code to avoid collisions » Refactor rooms datepicker js code to avoid collisions
jwilson3’s picture

Status: Active » Fixed
FileSize
11.1 KB
jwilson3’s picture

I've fixed this in master branch, but have included a patch here, in case someone wants to have a look.

jwilson3’s picture

There is more work that needs to be done here. Looks like we need to properly expose configurations like core does it elsewhere using #datepicker_options.

See #2046177: Use #datepicker_options to pass settings to Rooms date popups which should be considered a follow-up to this issue.

jwilson3’s picture

Status: Fixed » Reviewed & tested by the community

I think i'll revert this to RTBC until we've had a chance to actually push this change out to drupal.org.

ItangSanjana’s picture

I will soon report back after trying this. Thanks!

jwilson3’s picture

Issue tags: +7.1

  • Commit 72f89ca on master, 7.x-1.x by jwilson3:
    Issue #2151565 by jwilson3: prevent js datepicker collisions.
    
jwilson3’s picture

Status: Reviewed & tested by the community » Fixed

This is now fixed in 7.x-1.1

Status: Fixed » Closed (fixed)

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