The Firefox browser has a bug where, under certain conditions, it issues multiple GET requests for the same URL. (See Firefox bugs 61363 and 236858. The problem supposedly occurs when Firefox guesses wrong about the character encoding on the page and has to reparse the byte stream; rather than caching the bytes, it makes multiple GET requests. However, I've seen multiple GET requests in the Apache log even when all three of 1) browser setting, 2) encoding in HTTP Content-Type response header, and 3) encoding in Content-Type in HTML META tag agree.)

Since administer-->blocks (URL: admin/block) in Drupal recreates the blocks table even on a GET request, this can cause the blocks table to be corrupted by multiple near-simultaneous requests for that page.

To reproduce:

  1. In MySQL, do: "select theme, count(*) from blocks group by theme;"
  2. In Firefox, click on the menu item administer-->blocks.
  3. In MySQL, do: "select theme, count(*) from blocks group by theme;"

Expected result: The counts in #1 and #3 are equal

Actual (occasional) result: The counts in #1 and #3 differ; resulting in duplicate blocks in the current theme. Either then or on the next request your block settings may be corrupted as well.

Possible fixes:

  • Change block.module to not do any database changes on GET requests. (This probably means that there must be some other way of detecting block additions or updates because of added or updated modules. Perhaps detect the added/changed modules during the GET request and ask the user to do a POST request to update the block information before proceeding.)
  • or, make sure the database changes are inside a transaction, and that a SERIALIZABLE transaction isolation level is used (since the first query is a SELECT),
  • or, use POST to navigate to admin/block instead.

Workaround: Use Internet Explorer or Opera when administering blocks.

Comments

Mark Rose’s picture

Version: 4.7.0 » 4.7.2

I upgraded to 4.7.2 to look at the code in block.module, and the same problem exists. Function is "_block_rehash()".

killes@www.drop.org’s picture

Status: Active » Closed (won't fix)

I am using firefox exclusivly and have never had a corrupted block table.

https://bugzilla.mozilla.org/show_bug.cgi?query_format=specific&order=re...

This indicates that setting a charset is sufficient to mitigate this problem. Drupal does this.

Ergo: Won't fix.