- miiimooo Europe
Tested this with a media entity (Media source: File, the file is stored in a simple File field type):
- The name/label of the merged entity got overwritten with the file name (my media entity type is configured with a field mapping Name -> Name; maybe that's causing this?)
- The label on the media "Merge translations" form says "Remove term" instead of "Remove media"
- Loading the merge form I get
reset(): Calling reset() on an object is deprecated in Drupal\merge_translations\Form\MergeTranslationsForm->__construct() (line 113 of /app/web/modules/contrib/merge_translations/src/Form/MergeTranslationsForm.php).:"
- Status changed to Needs review
over 1 year ago 10:50am 20 November 2023 - 🇨🇴Colombia sebasgd
I've tested this patch and it seems to work. I only found minor thing and is that when you try to merge media, the option to remove the source item says "Remove term" instead of "Remove media".
- Status changed to Needs work
8 months ago 2:13pm 7 August 2024 - 🇫🇮Finland sokru
Otherwise looks good, but the issue reported by @sebasgd on #14 needs to be resolved.
Maybe increasing the test coverage for this wouldn't hurt, for that I'd recommend merging 📌 Set up Gitlab CI Fixed first. - 🇵🇱Poland lamp5 Rzeszow
📌 Set up Gitlab CI Fixed merged, If you have a free time, you can go ahead with this task.
- Status changed to Needs review
8 months ago 2:42pm 11 August 2024 - 🇫🇮Finland sokru
Resolved the issue mentioned on #14 by changing the option to more generic.
I also refactored the tests to include test for actual merging.
Leaving up to maintainers if they wish tests also for media entities. IMHO it feels a bit of repetition (and maintenance burden) to include also tests for media entities. - 🇺🇸United States banoodle San Francisco, CA
Patch #5 no longer applies on the latest 2.0.x-dev branch.
Attaching re-rolled patch.
Thanks!
- miiimooo Europe
If you need to patch 2.0.0 here is the old patch that still applies correctly
- Status changed to Needs work
about 18 hours ago 10:39am 4 April 2025 - miiimooo Europe
* Tested with media entity and works
* Tested with taxonomy term entity and failed:Drupal\Core\Entity\Query\QueryException: 'created' not found in Drupal\Core\Entity\Query\Sql\Tables->ensureEntityTable() (line 369 of /app/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php). #0 /app/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php(263): Drupal\Core\Entity\Query\Sql\Tables->ensureEntityTable('', 'created', 'LEFT', NULL, 'base_table', 'tid', Array) #1 /app/web/core/lib/Drupal/Core/Entity/Query/Sql/Query.php(296): Drupal\Core\Entity\Query\Sql\Tables->addField('created', 'LEFT', NULL) #2 /app/web/core/lib/Drupal/Core/Entity/Query/Sql/Query.php(197): Drupal\Core\Entity\Query\Sql\Query->getSqlField('created', NULL) #3 /app/web/core/lib/Drupal/Core/Entity/Query/Sql/Query.php(83): Drupal\Core\Entity\Query\Sql\Query->addSort() #4 /app/web/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php(364): Drupal\Core\Entity\Query\Sql\Query->execute() #5 /app/web/core/lib/Drupal/Core/Entity/EntityAutocompleteMatcher.php(47): Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection->getReferenceableEntities('term', 'CONTAINS', 10) #6 /app/web/core/modules/system/src/Controller/EntityAutocompleteController.php(117): Drupal\Core\Entity\EntityAutocompleteMatcher->getMatches('taxonomy_term', 'hrw_unpublished...', Array, 'term') #7 [internal function]: Drupal\system\Controller\EntityAutocompleteController->handleAutocomplete(Object(Symfony\Component\HttpFoundation\Request), 'taxonomy_term', 'hrw_unpublished...', 'H2ypDlTHW-MujMx...') #8 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #9 /app/web/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #10 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #11 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #12 /app/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #13 /app/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #14 /app/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 /app/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /app/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 /app/vendor/asm89/stack-cors/src/Cors.php(53): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 /app/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Asm89\Stack\Cors->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 /app/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 /app/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 /app/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /app/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /app/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #24 {main}
Location: .../entity_reference_autocomplete/taxonomy_term/hrw_unpublished_term/H2ypDlTHW-MujMxTgcs_kHX-DkfySQNMvpmbeokNHr0?q=term