Child pages
  • [caching] SQL error, when editing an item right after deploy [5.2.2]
Skip to end of metadata
Go to start of metadata

When attempting to edit an item in temporary table (e.g. a phrase) right after somebody else did a deploy (e.g. on web server from command line), then editing attempt fails and these errors happen:

  • Notice (#3): Undefined index: IDs in ...\core\kernel\utility\temp_handler.php on line 908

  • Notice (#4): Undefined index: Prefix in ...\core\kernel\utility\temp_handler.php on line 437

  • Notice (#5): Undefined index: TableName in ...\core\kernel\utility\temp_handler.php on line 438

  • Notice (#6): Undefined index: TableName in ...\core\kernel\utility\temp_handler.php on line 440

And then following exception happen:

RuntimeException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE 0' at line 4 (1064)
SQL:
    CREATE TABLE aei_ses_360696139_edit_
    SELECT *
    FROM WHERE 0

Since deploy happened right before that the next user action triggers unit config cache rebuild, which has one small issue: the cache built right after the deploy isn't the same as for next website visitor. The difference is that it doesn't include build events for built-in system classes, which includes TempHandler.

Solution

Register default build events in the "kCacheManager::EmptyUnitCache" method.

Related Tasks

INP-1525 - Getting issue details... STATUS