Skip to content

Conversation

@Steveb-p
Copy link
Contributor

@Steveb-p Steveb-p commented Feb 8, 2023

Question Answer
JIRA issue IBX-5044
Type bug
Target version v4.4
BC breaks no
Tests pass yes
Doc needed no

Issue discovered when trying to provide a sample for:
ibexa/documentation-developer#1857

The following request towards /views endpoint will fail due to DateMetadataCriterion.Value being passed as string from the XML decoding service:

<?xml version="1.0" encoding="UTF-8"?>
<ViewInput>
  <identifier>TitleView</identifier>
  <Query>
    <Filter>
      <DateMetadataCriterion>
        <Target>modified</Target>
        <Value>1675681020</Value>
        <Operator>gte</Operator>
      </DateMetadataCriterion>
    </Filter>
    <limit>10</limit>
    <offset>0</offset>
    <SortClauses>
      <ContentName>ascending</ContentName>
    </SortClauses>
  </Query>
</ViewInput>

Results in:

{
  "ErrorMessage": {
    "_media-type": "application\/vnd.ibexa.api.ErrorMessage+json",
    "errorCode": 400,
    "errorMessage": "Bad Request",
    "errorDescription": "Invalid Criterion id <DateMetadataCriterion> in <AND>",
    "trace": "...",
    "file": "\/home\/pniedzielski\/PhpstormProjects\/rest\/src\/lib\/Server\/Input\/Parser\/Criterion.php",
    "line": 45,
    "Previous": {
      "_media-type": "application\/vnd.ibexa.api.ErrorMessage+json",
      "ErrorMessage": {
        "_media-type": "application\/vnd.ibexa.api.ErrorMessage+json",
        "errorCode": 400,
        "errorMessage": "Bad Request",
        "errorDescription": "Invalid <Value> format",
        "trace": "..."
        "file": "\/home\/pniedzielski\/PhpstormProjects\/rest\/src\/lib\/Server\/Input\/Parser\/Criterion\/DateMetadata.php",
        "line": 68
      }
    }
  }
}

TODO:

  • Implement tests.
  • Fix new code according to Coding Standards ($ composer fix-cs).
  • Ask for Code Review.

@Steveb-p Steveb-p requested a review from a team February 8, 2023 10:48
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@konradoboza konradoboza requested a review from a team February 8, 2023 10:52
Copy link

@jwibexa jwibexa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and validated on 4.4.0

@jwibexa
Copy link

jwibexa commented Feb 13, 2023

Issue found during testing
https://issues.ibexa.co/browse/IBX-5075

@Steveb-p Steveb-p merged commit c56516e into main Feb 13, 2023
@Steveb-p Steveb-p deleted the ibx-5044-fix-date-metadata-xml branch February 13, 2023 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants