Uploaded image for project: 'Ibexa IBX'
  1. Ibexa IBX
  2. IBX-8046

Sending Relation to trash will crash ibexa_route function

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • Customer request
    • 4.5.6, 4.6.2
    • None
    • None
    • Yes

    Description

      Steps to reproduce

      1. Install ibexa DXP
      2. Create a content type with relation list field
      3. Create a content using created CT and add 2-3 contents to relation
      4. Create view match
      ibexa:
          system:
              default:
                  content_view:
                      full:
                          test:
                              template: "@ibexadesign/full/test.html.twig"
                              match:
                                  Id\Location: 70 
      1. Create a file under /templates/themes/standard/full/test.html.twig 
      {% extends '@ibexadesign/pagelayout.html.twig' %}
      
      {% block content %}
          {% set contents = ibexa_field_value(content, 'field_660684ef4a486').destinationContentIds %}
          {% for c in contents %}
          {% set routeReference = ibexa_route("ibexa.url.alias", {'contentId': c }) %}
          <a href="{{ ibexa_url(routeReference) }}">LINK</a>
          {% endfor %}
      {% endblock %}
       
      1. Move one of content relation to Trash
      2. go to view content

       

      Result

      After entering the view content, we receive an error:

      An exception has been thrown during the rendering of a template ("Cannot generate a UrlAlias route for content without main Location.").

      Expected Result

      The error should not appear and the content should be generated correctly (without trashed content)

       

      Note

      Problem is with ibexa_route and ibexa_url

       

      Designs

        Attachments

          Activity

            People

              Unassigned Unassigned
              mateusz.debinski@ibexa.co Mateusz Dębiński
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: