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

UrlStorage::getFieldData logs an error if URL with an empty ID is not found

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Low Low
    • Resolution: Fixed
    • Affects Version/s: 2014.07
    • Fix Version/s: 5.4.0-rc1, 5.4.0, 5.3.8
    • Component/s: Field types
    • Labels:
      None

      Description

      The logger should only log an error where there's an actual ID stored in the database, and not for ID which is 0 or null, which is the default for an ezurl field type which has no content.

        Issue Links

          Activity

          Hide
          Bertrand Dunogier added a comment -

          The test thing aside, I was able to reproduce it immediately.

          First, make sure logging is enabled. It isn't enabled (iirc) by default in prod mode. Just switch to dev, and you'll be fine.
          Also, if you revert the patch, or move to another version, make sure you clear persistence cache (rm -rf ~ezp5/ezpublish/cache/dev/stash/*). The result of the fixed code is cached, and the code won't run again if you don't clear cache.

          What I did, on master (should apply to 5.4 as well):
          1. reverted e4314cd49a3e8dd0775a9fca526268a3ec84fbeb
          2. created a Link object without an URL
          3. Made a REST request to the created content. Example with HTTPie: http -a admin:publish GET http://php55-vm.ezpublish5/api/ezp/v2/content/objects/143 'Accept:application/vnd.ez.api.Content+json'
          4. Checked that I had an error in my log: [2014-12-19 11:58:00] app.ERROR: URL with ID '0' not found [] []

          Show
          Bertrand Dunogier added a comment - The test thing aside, I was able to reproduce it immediately. First, make sure logging is enabled . It isn't enabled (iirc) by default in prod mode. Just switch to dev, and you'll be fine. Also, if you revert the patch, or move to another version, make sure you clear persistence cache (rm -rf ~ezp5/ezpublish/cache/dev/stash/*). The result of the fixed code is cached, and the code won't run again if you don't clear cache. What I did, on master (should apply to 5.4 as well): 1. reverted e4314cd49a3e8dd0775a9fca526268a3ec84fbeb 2. created a Link object without an URL 3. Made a REST request to the created content. Example with HTTPie: http -a admin:publish GET http://php55-vm.ezpublish5/api/ezp/v2/content/objects/143 'Accept:application/vnd.ez.api.Content+json' 4. Checked that I had an error in my log: [2014-12-19 11:58:00] app.ERROR: URL with ID '0' not found [] []
          Hide
          Edi Modrić (Inactive) added a comment -

          > Actually, Edi, your test was invalid. It was passing thanks to a side effect, but doesn't fail as expected if executed without your patch: you were not calling the tested method
          > Sent a PR for that: https://github.com/ezsystems/ezpublish-kernel/pull/1119.

          Good catch!

          > First, make sure logging is enabled. It isn't enabled (iirc) by default in prod mode. Just switch to dev, and you'll be fine.

          This was probably the reason why Ricardo failed to detect the error. I'm always installing eZ in dev mode, while prod is the default one. It didn't occur to me to mention it.

          Show
          Edi Modrić (Inactive) added a comment - > Actually, Edi, your test was invalid. It was passing thanks to a side effect, but doesn't fail as expected if executed without your patch: you were not calling the tested method > Sent a PR for that: https://github.com/ezsystems/ezpublish-kernel/pull/1119 . Good catch! > First, make sure logging is enabled. It isn't enabled (iirc) by default in prod mode. Just switch to dev, and you'll be fine. This was probably the reason why Ricardo failed to detect the error. I'm always installing eZ in dev mode, while prod is the default one. It didn't occur to me to mention it.
          Hide
          Ricardo Correia (Inactive) added a comment - - edited

          @Bertrand Dunogier and Edi Modrić,
          I was able to reproduce the issue by creating a Link object without URL.
          That did the trick.

          Show
          Ricardo Correia (Inactive) added a comment - - edited @ Bertrand Dunogier and Edi Modrić , I was able to reproduce the issue by creating a Link object without URL. That did the trick.
          Hide
          Bertrand Dunogier added a comment - - edited
          Show
          Bertrand Dunogier added a comment - - edited ezpublish-kernel#1119 merged to master@e3fd32 .
          Hide
          Ricardo Correia (Inactive) added a comment -

          QA approved.

          Show
          Ricardo Correia (Inactive) added a comment - QA approved.

            People

            • Assignee:
              Unassigned
              Reporter:
              Edi Modrić
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: