Layouts Are Not Updated On Displays - 1.8 Dev

At some point it looks like the ability to update layouts on displays stopped working.

When checking the Manage page of a display we see this:

SQLSTATE[42000]: Syntax error or access violation: 1064 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 '// `xml` = NULL, `status` = '1',

Part of the Log:

665	7517529	2015-11-07 09:39	WEB	GET	DEBUG		/layout/status/:id	Storage rollback.
664	7517529	2015-11-07 09:39	WEB	GET	ERROR		/layout/status/:id	SQLSTATE[42000]: Syntax error or access violation: 1064 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 '// `xml` = NULL, `status` = '1', `userI' at line 12 Exception Type: PDOException
663	7517529	2015-11-07 09:39	WEB	GET	DEBUG		/layout/status/:id	SQLSTATE[42000]: Syntax error or access violation: 1064 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 '// `xml` = NULL, `status` = '1', `userI' at line 12#0 C:\wamp\www\xibo18alpha\lib\Storage\PDOConnect.php(154): PDOStatement->execute(Array) #1 C:\wamp\www\xibo18alpha\lib\Entity\Layout.php(812): Xibo\Storage\PDOConnect::update('\n UPDATE...', Array) #2 C:\wamp\www\xibo18alpha\lib\Entity\Layout.php(398): Xibo\Entity\Layout->update() #3 C:\wamp\www\xibo18alpha\lib\Entity\Layout.php(714): Xibo\Entity\Layout->save(Array) #4 C:\wamp\www\xibo18alpha\lib\Controller\Layout.php(863): Xibo\Entity\Layout->xlfToDisk() #5 [internal function]: Xibo\Controller\Layout->status('2') #6 C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Route.php(173): call_user_func_array(Array, Array) #7 [internal function]: Slim\Route->Slim\{closure}('2') #8 C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Route.php(468): call_user_func_array(Object(Closure), Array) #9 C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Slim.php(1357): Slim\Route->dispatch() #10 C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Middleware\Flash.php(85): Slim\Slim->call() #11 C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Middleware\MethodOverride.php(92): Slim\Middleware\Flash->call() #12 C:\wamp\www\xibo18alpha\lib\Middleware\Actions.php(78): Slim\Middleware\MethodOverride->call() #13 C:\wamp\www\xibo18alpha\lib\Middleware\WebAuthentication.php(118): Xibo\Middleware\Actions->call() #14 C:\wamp\www\xibo18alpha\lib\Middleware\CsrfGuard.php(64): Xibo\Middleware\WebAuthentication->call() #15 C:\wamp\www\xibo18alpha\lib\Middleware\Theme.php(33): Xibo\Middleware\CsrfGuard->call() #16 C:\wamp\www\xibo18alpha\lib\Middleware\State.php(96): Xibo\Middleware\Theme->call() #17 C:\wamp\www\xibo18alpha\lib\Middleware\Storage.php(39): Xibo\Middleware\State->call() #18 C:\wamp\www\xibo18alpha\vendor\slim\slim\Slim\Slim.php(1302): Xibo\Middleware\Storage->call() #19 C:\wamp\www\xibo18alpha\web\index.php(121): Slim\Slim->run() #20 {main}
662	7517529	2015-11-07 09:39	WEB	GET	DEBUG		/layout/status/:id	Editing Layout TEST. Id = 2
661	7517529	2015-11-07 09:39	WEB	GET	DEBUG		/layout/status/:id	Saving Layout TEST - 1920 x 1080. Regions = 1, Tags = 0. layoutId = 2. Status = 1 with options
660	7517529	2015-11-07 09:39	WEB	GET	DEBUG		/layout/status/:id	SQL = SELECT layout.layoutID, layout.layout, layout.description, layout.duration, layout.userID, `user`.UserName AS owner, campaign.CampaignID, layout.status, layout.width, layout.height, layout.retired, layout.createdDt, layout.modifiedDt, (SELECT GROUP_CONCAT(DISTINCT tag) FROM tag INNER JOIN lktaglayout ON lktaglayout.tagId = tag.tagId WHERE lktaglayout.layoutId = layout.LayoutID GROUP BY lktaglayout.layoutId) AS tags, layout.backgroundImageId, layout.backgroundColor, layout.backgroundzIndex, layout.schemaVersion, NULL as displayOrder, (SELECT GROUP_CONCAT(DISTINCT `group`.group) FROM `permission` INNER JOIN `permissionentity` ON `permissionentity`.entityId = permission.entityId INNER JOIN `group` ON `group`.groupId = `permission`.groupId WHERE entity = :permissionEntityForGroup AND objectId = campaign.CampaignID AND view = 1 ) AS groupsWithPermissions FROM layout INNER JOIN `lkcampaignlayout` ON lkcampaignlayout.LayoutID = layout.LayoutID INNER JOIN `campaign` ON lkcampaignlayout.CampaignID = campaign.CampaignID AND campaign.IsLayoutSpecific = 1 INNER JOIN `user` ON `user`.userId = `campaign`.userId WHERE 1 = 1 AND layout.layout = :exact AND layout.layoutId <> :notLayoutId AND layout.userid = :userId AND layout.retired = :retired AND layout.layoutID NOT IN (SELECT layoutId FROM lktaglayout WHERE tagId = 1) ORDER BY layout. Params = array ( 'permissionEntityForGroup' => 'Xibo\\Entity\\Campaign', 'exact' => 'TEST', 'notLayoutId' => 2, 'userId' => 1, 'retired' => 0, ).
659	7517529	2015-11-07 09:39	WEB	GET	DEBUG		/layout/status/:id	SQL = SELECT media.mediaId, media.name, media.type AS mediaType, media.duration, media.userId AS ownerId, media.fileSize, media.storedAs, media.valid, media.moduleSystemFile, media.expires, media.md5, media.retired, media.isEdited, IFNULL((SELECT parentmedia.mediaid FROM media parentmedia WHERE parentmedia.editedmediaid = media.mediaid),0) AS parentId, (SELECT GROUP_CONCAT(DISTINCT tag) FROM tag INNER JOIN lktagmedia ON lktagmedia.tagId = tag.tagId WHERE lktagmedia.mediaId = media.mediaID GROUP BY lktagmedia.mediaId) AS tags, `user`.UserName AS owner, (SELECT GROUP_CONCAT(DISTINCT `group`.group) FROM `permission` INNER JOIN `permissionentity` ON `permissionentity`.entityId = permission.entityId INNER JOIN `group` ON `group`.groupId = `permission`.groupId WHERE entity = :entity AND objectId = media.mediaId AND view = 1 ) AS groupsWithPermissions, media.originalFileName AS fileName FROM media LEFT OUTER JOIN media parentmedia ON parentmedia.MediaID = media.MediaID INNER JOIN `user` ON `user`.userId = `media`.userId WHERE 1 = 1 AND media.mediaId = :mediaId ORDER BY name. Params = array ( 'entity' => 'Xibo\\Entity\\Media', 'mediaId' => 57, ).
658	7517529	2015-11-07 09:39	WEB	GET	DEBUG		/layout/status/:id	SQL = SELECT ModuleID, Module, Name, Enabled, Description, render_as, settings, RegionSpecific, ValidExtensions, ImageUri, PreviewEnabled, assignable, SchemaVersion, viewPath, `class` FROM `module` WHERE 1 = 1 AND module = :type ORDER BY Module. Params = array ( 'type' => 'image', ).

You may recall that we dropped the xml field on the layout table because it isn’t used anymore?

It looks like your Layout Edit entity still has the XML field present - this is not the case in the develop branch, perhaps you could compare the two?

Hi Dan,

Yes we already seemed to have that change, so we decided to take the entire file new again from the dev branch and all is working.

1 Like