Skip to content
Snippets Groups Projects

Cannot save translated nodes after upgrading to 8.8 due to invalid path

Closed quietone requested to merge issue/drupal-3101344:3101344-cannot-save-translated into 11.x
2 files
+ 71
0
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -5,6 +5,7 @@
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\WidgetBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element;
use Symfony\Component\Validator\ConstraintViolationInterface;
/**
@@ -82,6 +83,11 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
* The form state.
*/
public static function validateFormElement(array &$element, FormStateInterface $form_state) {
// Only set errors if the element is visible.
if (!Element::isVisibleElement($element)) {
return;
}
// Trim the submitted value of whitespace and slashes.
$alias = rtrim(trim($element['alias']['#value']), " \\/");
if ($alias !== '') {
Loading