Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-22335

Erroneous NotFound Exception when using LocationService to update location if values are identical to existing settings.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Medium Medium
    • Resolution: Unresolved
    • Affects Version/s: 5.2
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Mac OSX
      MySQL Server 5.6.13
      PHP 5.3.27 CLI, Zend 2.3.0, XDebug 2.2.3

      Description

      If you call LocationService->updateLocation, and the details of your locationUpdateStruct match those already in the database, the LocationService will throw a NotFound exception, when in fact the record was found and no changes were made.

      The issue stems from the way that the Legacy storage engine confirms the update:

      https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/Persistence/Legacy/Content/Location/Gateway/DoctrineDatabase.php#L1136

      By performing a row count of affected rows, and assuming that a 0 means the object was missing, a misleading exception is generated. To allow for idempotent operation, updating a record with its existing values shouldn't generate an exception.

      A possible correction would be to check the struct against the location in the location service, before the storage engine.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Joe Kepley
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: