[contributions(DRUPAL-6--1):frodo] /modules/editview/includes editview.views.inc /modules/editview/theme editview.js
User: frodo Branch: DRUPAL-6--1 Date: Wed, 10 Nov 2010 19:04:30 +0000 Modified files: /modules/editview/includes editview.views.inc /modules/editview/theme editview.js Log message: In commit #410226 the code which was somewhat cryptically marked as "Rebuild form until element IDs match originals" was removed. This commit adds replacement code that is hopefully more robust. Drupal tries to make sure any HTML id's are truly unique by appending serial numbers to them to avoid clashes. These numbers are not remembered anywhere between page loads, though, and especially not when doing AJAX callbacks. That means that if an AJAX function returns HTML with id's, there is no guarantee these id's are not already used in a page. Most browsers do not really care and render pages with duplicate id's without much trouble - until some Javascript code tries to identify elements by their id's. Then all kinds of unexpected things happen. The new code in this commit remembers all id's used in a form within an editview. Regrettably, these unique id's are only generated at a very late stage of the handling of the form, and at that moment it is too hard to add this information directly to the form. Instead we save it through Drupal.settings and use Javascript to copy it to a hidden form element. Note that the whole issue of unique id's only matters when using Javascript AJAX callbacks, so this will do no harm if Javascript has been switched off. The id's are put into an array which is serialized, gzipped and finally base-64 encoded to keep it small. This is typically about 1.5 KB overhead for each displayed form. Links: http://cvs.drupal.org/diff.php?path=contributions/modules/editview/includes/... http://cvs.drupal.org/diff.php?path=contributions/modules/editview/theme/edi...
participants (1)
-
drupal-cvs@drupal.org