Skip to content

Broken edit link in ca_entities relationship bundle creates empty entity_id URL #1953

Description

@Victor-van-Dijk

Title: Broken edit link in ca_entities relationship bundle creates empty entity_id URL

Environment

  • CollectiveAccess Providence 2.0.12
  • Installation through Docker
  • Default theme
  • Entity → Related entities bundle
  • File: themes/default/views/bundles/ca_entities.php
  • Bug/error: EntityEditor/Edit/entity_id/
  • Solution: {entity_id} → {id}

Description
When adding a new entity relationship, the edit arrow icon can generate an invalid URL:

/backend/index.php/editor/entities/EntityEditor/Edit/entity_id/

The URL is missing the entity ID, resulting in:

Something went wrong
There was an uncaught fatal error.

Steps to reproduce

  1. Open an Entity record.
  2. Go to the "Related entities" relationship bundle.
  3. Remove the existing empty relationship row using the X button.
  4. Click "Add relationship".
  5. Select or create a related entity.
  6. Click the arrow icon to edit the related entity.

Expected behaviour
The arrow should open the related entity editor, for example:

/backend/index.php/editor/entities/EntityEditor/Edit/ScreenXX/entity_id/123

Actual behaviour
The generated link is:

/backend/index.php/editor/entities/EntityEditor/Edit/entity_id/

Cause found
The problem appears to be in:

themes/default/views/bundles/ca_entities.php

The template for new relationship items contained:

caEditorUrl($this->request, 'ca_entities', '{entity_id}')

but the template value available in this context is {id}.

Changing it to:

caEditorUrl($this->request, 'ca_entities', '{id}')

restores the correct URL generation.

This may affect other users because the failure is only triggered when creating a new relationship row.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions