- Open on Drupal.org →Core: 10.2.x + Environment: PHP 8.1 & MariaDB 10.3.22last update
7 months ago Waiting for branch to pass - 🇩🇪Germany ckaotik Berlin
I've added a test case for this and hope it makes sense. My approach is a bit different, I look for the
.field__label
class (instead of both.field__label
and.field__item
) and addcontenteditable="false"
to those. If such a label was found, the user cannot edit it, to hopefully prevent some confusion. Label contents are stripped from the saved value. If there's no dedicated label, everything stays the same as before.The general problem is that we need some way to figure out what's the label and what's the actual value we want edited. This is however highly dependent on the theme :( So for now, you'd need to add that
field__label
class to your templates. - Open on Drupal.org →Core: 10.2.x + Environment: PHP 8.1 & MariaDB 10.3.22last update
7 months ago Waiting for branch to pass - 🇩🇪Germany ckaotik Berlin
Follow-up patch that fixes restoring the original field after changes were made and discarded.
We should probably also add tests for "the label is displayed as expected after discarding changes". - Open on Drupal.org →Core: 10.2.x + Environment: PHP 8.1 & MariaDB 10.3.22last update
7 months ago Waiting for branch to pass - 🇩🇪Germany ckaotik Berlin
Fix whitespace, thanks text editor... Also added an interdiff.