Bug #86664

Slug isn't fully adopted after updating via update button

Added by Oliver Bartsch 10 months ago. Updated 3 days ago.

Status:
Resolved
Priority:
Must have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2018-10-15
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:
On Location Sprint

Description

Current behaviour:
After updating the slug field in the page properties via the update button the new value isn't fully adopted.

Steps to reproduce:
  1. Create a page
  2. Rename the page
  3. Update the slug field via the update button
  4. Click the button to input a slug manually
  5. Change the slug manually
  6. Click the button for manually slug input again

Would expect:
After updating the slug the new value should be also in the field when clicking the “manual slug” and after the manually change the value should be this and not the value from updating.

slug-update.mp4 (882 KB) Oliver Bartsch, 2018-10-15 20:48


Related issues

Related to TYPO3 Core - Bug #87122: FormEngine field type "slug": Edit after Recalculation shows wrong value Closed 2018-12-11

Associated revisions

Revision 6936c06d (diff)
Added by Oliver Bartsch 3 days ago

[BUGFIX] Ensure manually updated slug is saved correctly

This fixes the bug, that after updating the slug and clicking
the toggle URL button, the slug isn't updated correctly.

Therefore, if the value of the input and read only field differ
after clicking the toggle button, now the updated value
of the input field is written into the read only and hidden field.

Furthermore after recreating the slug, the new value is now also
written into the input field to be present after clicking
the toogle URL button again. Otherwise the recreated slug would be
discarded on save.

Resolves: #86664
Releases: master, 9.5
Change-Id: I1cd8652618a7c5f2f7154c499ef1653bfed73c53
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61482
Tested-by: TYPO3com <>
Tested-by: Jens Ulrich <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Jens Ulrich <>
Reviewed-by: Andreas Fernandez <>

Revision fead2bef (diff)
Added by Oliver Bartsch 3 days ago

[BUGFIX] Ensure manually updated slug is saved correctly

This fixes the bug, that after updating the slug and clicking
the toggle URL button, the slug isn't updated correctly.

Therefore, if the value of the input and read only field differ
after clicking the toggle button, now the updated value
of the input field is written into the read only and hidden field.

Furthermore after recreating the slug, the new value is now also
written into the input field to be present after clicking
the toogle URL button again. Otherwise the recreated slug would be
discarded on save.

Resolves: #86664
Releases: master, 9.5
Change-Id: I1cd8652618a7c5f2f7154c499ef1653bfed73c53
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61514
Tested-by: TYPO3com <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Andreas Fernandez <>

History

#1 Updated by Oliver Bartsch 10 months ago

  • Description updated (diff)

#2 Updated by Stephan Großberndt 10 months ago

  • Subject changed from Slug isn't fully adpoted after updating via update button to Slug isn't fully adopted after updating via update button
  • Description updated (diff)

#3 Updated by Susanne Moog 10 months ago

  • Sprint Focus set to On Location Sprint

#4 Updated by Oliver Bartsch 8 months ago

  • Related to Bug #87122: FormEngine field type "slug": Edit after Recalculation shows wrong value added

#5 Updated by Josef Glatz 8 months ago

  • Category changed from Link Handling, Site Handling & Routing to FormEngine aka TCEforms
  • Priority changed from Should have to Must have

#6 Updated by Oliver Bartsch 14 days ago

Oliver Bartsch wrote:

Current behaviour:
After updating the slug field in the page properties via the update button the new value isn't fully adopted.

Steps to reproduce:
  1. Create a page
  2. Rename the page
  3. Update the slug field via the update button
  4. Click the button to input a slug manually
  5. Change the slug manually
  6. Click the button for manually slug input again

Would expect:
After updating the slug the new value should be also in the field when clicking the “manual slug” and after the manually change the value should be this and not the value from updating.

While investigating in more detail, it gets clear that this isn't only a visual bug rather than a functional one.
Because not only the value of the readOnlyField isn't changed, the manually changed slug doesn't get written into the hidden input field at all.
Thats why the record still contains the old slug after saving.

Given a site with the current slug `/home`.
Following output is generated when running these console commands after different steps:

console.log('Input field: ' + $(".t3js-form-field-slug-input").val());
console.log('ReadOnly field: ' + $(".t3js-form-field-slug-readonly").val());
console.log('Hidden field: ' + $(".t3js-form-field-slug-hidden").val());

1. Open the record:

// Input field: /home
// ReadOnly field: /home
// Hidden field: /home

2. Click the toggle URL button:

// Input field: /home
// ReadOnly field: /home
// Hidden field: /home

3. Change the slug segment to `/home-test`:

// Input field: /home-test
// ReadOnly field: /home
// Hidden field: /home-test

4. Click the toggle URL button again:

// Input field: /home-test
// ReadOnly field: /home
// Hidden field: /home

If one save the record after step 3, the new slug will get written into database.
But if one click on the toggle button (step 4) again the hidden field which is responsible for the update is changed to the old value and the manually changed slug won't get written into database.

#7 Updated by Gerrit Code Review 14 days ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61482

#8 Updated by Gerrit Code Review 10 days ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61482

#9 Updated by Oliver Bartsch 7 days ago

Furthermore while testing the new Bugfix, I found another misbehavior.

If one updates the slug via the "slug-recreate" recreate button, the recreated slug is written into the hidden and the read only field But not into the input field. As a result, if one clicks the toggle URL button after recreating the slug, the input field with the old slug shows up instead of the recreated one.

#10 Updated by Gerrit Code Review 7 days ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61482

#11 Updated by Gerrit Code Review 3 days ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61514

#12 Updated by Oliver Bartsch 3 days ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF