Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

Localized taxonomies routes in routes.yaml cause php error in taxonomies/edit.blade.php #2518

Open
piotrbochniak opened this issue May 21, 2020 · 0 comments

Comments

@piotrbochniak
Copy link

piotrbochniak commented May 21, 2020

Describe the bug
Localized taxonomies routes in routes.yaml cause php error in taxonomies/edit.blade.php

To Reproduce
Steps to reproduce the behavior:

  1. Create a Taxonomy with any name/slug let's say "foobar" / "foobar"
  2. In routes.yaml add custom localized route for the "foobar" taxonomy
taxonomies:
  foobar:
    de: '/foobar-de/{slug}'
    fr: '/foobar-fr/{slug}'
    it: '/foobar-it/{slug}'
  1. Go to CP -> Taxonomies -> Manage Taxonomies -> foobar
  2. You will see a PHP error

Screenshots
PHP error screenshot 1
PHP error screenshot 2

Expected behavior
It should be allowed in the CP to edit Taxonomy with custom localized routes set.

Cause of the problem
In the statamic\resources\views\taxonomies\edit.blade.php it is assumed that a custom route should be a string
<input type="text" name="route" class="form-control" value="{{ $group->route() }}" />

It should be changed to work in a similar way to collection edit form statamic\resources\views\collections\edit.blade.php where there is a custom Vue Component used which allows to edit localized custom routes
<routes-fieldtype :data="{{ json_encode($routes) }}" name="routes"></routes-fieldtype>

Same applies to Taxonomy create form.

Environment details (please complete the following information):

  • Statamic Version [e.g. 2.11.20]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant