community-platform icon indicating copy to clipboard operation
community-platform copied to clipboard

[bug] previously used how to & research slugs not prevented from being used

Open iSCJT opened this issue 1 year ago • 0 comments

Describe the bug If the title of a how to or research item is updated then the slug is also updated, previously used slugs are saved for that item so that old links can be maintained however nothing prevents a new item from being created with a previously used slug.

To Reproduce Steps to reproduce the behaviour:

  1. Edit how-to / research item and change title
  2. Open item using original and new slugs to confirm that accessible using both
  3. Create how-to / research item and use the old title of the previous item
  4. Complete details of item and submit
  5. Observe that new item uses original slug and loads correctly but that it is not possible to access the edited item using the original slug.

Expected behaviour That current and previous slugs are globally unique across item type.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context My suggestion is a global lookup table of slugs and corresponding document id's which is checked before assigning a slug. If a slug is in use then either return the existing error about the title not being unique or auto append an incrementing number.

iSCJT avatar May 03 '23 15:05 iSCJT