- 🇳🇱Netherlands Summit
Hi,
Can this patch be used to import meta tags through feeds in Drupal 10?
Thanks for your reply in advance!
Greetings, Martijn - 🇮🇹Italy trickfun
I apply this patch on
metatag 2.0.0
feed 8.x-3.0-beta4i get this error
TypeError: array_merge(): Argument #2 must be of type array, null given in array_merge() (line 40 of modules/contrib/metatag/src/Feeds/Target/Metatag.php). Drupal\metatag\Feeds\Target\Metatag::prepareTarget(Object) (Line: 57) Drupal\feeds\Plugin\Type\Target\FieldTargetBase::targets(Array, Object, Array) (Line: 305) Drupal\feeds\Entity\FeedType->getMappingTargets() (Line: 105) Drupal\feeds\Form\MappingForm->buildForm(Array, Object, Object) call_user_func_array(Array, Array) (Line: 536) Drupal\Core\Form\FormBuilder->retrieveForm('feeds_mapping_form', Object) (Line: 283) Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73) Drupal\Core\Controller\FormController->getContentResult(Object, Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 182) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
i think feed integration is very important feature to have.
thank you Drupal 10
metatag 2.0.0#38 Metatag.php replace lines 36-38 with:
$metatag_basic = $metatag_manager->sortedGroupsWithTags()['basic']['tags'] ?? [];
$metatag_og = $metatag_manager->sortedGroupsWithTags()['open_graph']['tags'] ?? [];
$metatag_advanced = $metatag_manager->sortedGroupsWithTags()['advanced']['tags'] ?? [];- last update
10 months ago Patch Failed to Apply - last update
10 months ago 305 pass, 31 fail - last update
10 months ago 305 pass, 31 fail - 🇳🇱Netherlands djschoone Breda
#42 works. Made it into a new patch applied to
- Drupal 10.2.4
- Metatag 2.0.0
- Feeds 8.x-3.0-beta4
- 🇳🇱Netherlands djschoone Breda
#42 works. Made it into a new patch applied to
- Drupal 10.2.4
- Metatag 2.0.0
- Feeds 8.x-3.0-beta4
- 🇺🇸United States Jared Nolt
Patch #44 worked great in mapping Basic and Advanced schema fields! Would it be possible to map the Product Schema fields also?
- 🇺🇸United States DamienMcKenna NH, USA
For complex setups you might look at Schema.org Blueprints → instead of Schema.org Metatag, it's far more flexible in how it works.
I'm moving this to the 2.0.x branch, no further work is being done on the 8.x-1.x branch.
- First commit to issue fork.
- 🇯🇵Japan ptmkenny
Added a merge request with the code from patch #44 to make it easier to track future work.
- last update
7 months ago Unable to generate test groups - 🇵🇹Portugal tmiguelv
Hello!
In D11, I was getting the following error with the patch #44
Error: Class "Drupal\Feeds\FieldTargetDefinition" not found in include() (line 11 of /app/docroot/modules/contrib/metatag/src/Feeds/MetatagFieldTargetDefinition.php).It turns out it was because the "Drupal\Feeds\FieldTargetDefinition" use statement was in the wrong case.
I've changed "use Drupal\Feeds\FieldTargetDefinition;" to "use Drupal\feeds\FieldTargetDefinition;" and now it works.
- 🇯🇵Japan ptmkenny
@tmiguelv There is already an MR for this issue, and you can generate a patch from the MR. See downloading a patch file. →