Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi everyone,
I'm having compatibility problems with the Translation Management Tool. The code needs at least a couple of condition check in the better_formats_filter_process_format function.
if ($form_object instanceof Drupal\Core\Entity\ContentEntityForm) {
$entity = $element['#entity'];
$entity_type = $entity->getEntityTypeId();
$field_name = $element['#field_name'];
$field_definition = $entity->getFieldDefinition($field_name);
The $entity['#entity'] value doesn't exists in some cases.
Thank you
Comment | File | Size | Author |
---|---|---|---|
#3 | 11887466-fix-for-tmgmt-module-1.patch | 2.88 KB | aerrasti |
#2 | fix-for-tmgmt-module.patch | 2.88 KB | aerrasti |
Issue fork better_formats-2846970
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
aerrasti CreditAttribution: aerrasti commentedSorry,
I think that I mixed different ideas.
I was already using another patch for the paragraph issue : https://www.drupal.org/files/issues/better_formats_paragraphs-2754029-15...
So I updated the patch checking a new condition.
Comment #3
aerrasti CreditAttribution: aerrasti commentedI reupload the file with a proper name
Comment #4
mandclu CreditAttribution: mandclu as a volunteer and at Acquia commentedNot sure if this is still a problem, but checking that a variable contains the expected object before attempting to use its meant god seems sensible enough.
Comment #5
renatogI'd say that we can improve this logic with early return
Comment #6
renatogThe patch needs to be updated as well because it was implementing a hook_field_widget_form_alter but currently already have this hook at 8.x-1.x https://git.drupalcode.org/project/better_formats/-/blob/8.x-1.x/better_...