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:
- Create a page
- Rename the page
- Update the slug field via the update button
- Click the button to input a slug manually
- Change the slug manually
- 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.