Hi,
I’ve been testing out the latest version of Xibo CMS (2.0).
I just ran into an interesting issue when playing around with sending commands to an Android device (not sure if it’s a coincidence or not)…
However, I had two displays, but now it shows none when trying to access the Displays page (see screenshot).
I can still see the displays in the dashboard… so I know the records are still there.
Here’s the error I get when I turn on debugging and try accessing that page: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (cms.notification, CONSTRAINT notification_ibfk_1 FOREIGN KEY (userId) REFERENCES user (userId)) Exception Type: PDOException
Very weird… I had an android device and a windows device. I went to check on the windows device and it lost all of its local settings. The CMS address was back to localhost as well as the key. I updated it and after a few “bad requests” it finally reconnected back to the CMS. Now the display list is showing just fine.
Kind of concerning. I’d be interested to know if you might have any ideas what could have caused it or could point me deeper in the logs to figure it out.
This is happening to me again. This time around I just unplugged both units (to ship them out) and now my displays page is empty. Same error:
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (cms.notification, CONSTRAINT notification_ibfk_1 FOREIGN KEY (userId) REFERENCES user (userId)) Exception Type: PDOException
Is it something to do with the player being offline for X period of time?
EDIT: I found that it does have to do with sending notifications out. Things break at this point in the Display.php controller:
// Should we create a notification
if ($emailAlerts && $display->emailAlert == 1 && ($displayOffline || $alwaysAlert)) {
// Alerts enabled for this display
// Display just gone offline, or always alert
// Fields for email
$subject = sprintf((“Email Alert for Display %s”), $display->display);
$body = sprintf((“Display %s with ID %d was last seen at %s.”), $display->display, $display->displayId, $this->getDate()->getLocalDate($display->lastAccessed));
// Add to system
$notification = $this->notificationFactory->createSystemNotification($subject, $body, $this->getDate()->parse());
// Add in any displayNotificationGroups, with permissions
foreach ($this->userGroupFactory->getDisplayNotificationGroups($display->displayGroupId) as $group) {
$notification->assignUserGroup($group);
}
$notification->save();
After a bit more debugging… the notification UserID is being set to 0 which obviously is not a valid UserID. I got lost after trying to figure out how users are being assigned to the notifications.
Hopefully this helps though. A temporary workaround is disabling notifications, but I’d like to get those working