digitalfabrik / integreat-cms

Simplified content management back end for the Integreat App - a multilingual information platform for newcomers
https://digitalfabrik.github.io/integreat-cms/
Apache License 2.0
55 stars 33 forks source link

location_url in event incorrectly links to CMS #2852

Closed LeandraH closed 2 weeks ago

LeandraH commented 4 weeks ago

Describe the Bug

The location_url in events links to the CMS, not the app.

Steps to Reproduce

  1. Go to 'https://cms.integreat-app.de/testumgebung/de/wp-json/extensions/v3/events/?combine_recurring=True'
  2. Check in the event with the id 57026 (currently the second one in the array)
  3. See that the location_url is 'https://admin.integreat-app.de/testumgebung/de/locations/testort/'.

Expected Behavior

The location_url should be 'https://integreat.app/testumgebung/de/locations/testort', aka the link to the location in the app.

Actual Behavior

The location_url is 'https://admin.integreat-app.de/testumgebung/de/locations/testort/', aka the link to the location in the CMS.

steffenkleinle commented 4 weeks ago

Hmmm.... I am not sure if we should rather just use the slug/path instead of a full URL? That would provide us with more flexibility in the apps while probably less logic is required in the CMS (and it would follow the structure of all other properties/endpoints).

LeandraH commented 4 weeks ago

True, but then it's not really a bug ticket anymore :D

MizukiTemma commented 3 weeks ago

@steffenkleinle @LeandraH Is this change but still needed as enhancement?

LeandraH commented 3 weeks ago

That would be cool. I guess at that point it shouldn't be called location_url anymore but location_path?

MizukiTemma commented 3 weeks ago

@LeandraH @steffenkleinle

That would be cool. I guess at that point it shouldn't be called location_url anymore but location_path?

And should the outpup be "/testumgebung/de/locations/testort"?

steffenkleinle commented 3 weeks ago

@LeandraH @steffenkleinle

That would be cool. I guess at that point it shouldn't be called location_url anymore but location_path?

And should the outpup be "/testumgebung/de/locations/testort"?

Yes, but probably including a trailing slash.

MizukiTemma commented 2 weeks ago

@LeandraH @steffenkleinle Sorry, one more question: can location_url be removed without problem or is it being used somewhere in the app?

steffenkleinle commented 2 weeks ago

@LeandraH @steffenkleinle Sorry, one more question: can location_url be removed without problem or is it being used somewhere in the app?

It is not yet used so it can easily be removed.

LeandraH commented 2 weeks ago

Awesome, thank you for the quick fix!