Hello,
After installing Yoast SEO module 8.x-2.0-alpha6 version, adding the field on a taxonomy term and start testing, i have the following error :

Error: Call to undefined method Drupal\taxonomy\Entity\Term::getTitle() in Drupal\yoast_seo\EntityAnalyser->replaceContextAwareTokens() (line 161 of /var/www/html/docroot/modules/contrib/yoast_seo/src/EntityAnalyser.php)
#0 /var/www/html/docroot/modules/contrib/yoast_seo/src/EntityAnalyser.php(96): Drupal\yoast_seo\EntityAnalyser->replaceContextAwareTokens()
#1 /var/www/html/docroot/modules/contrib/yoast_seo/src/Form/AnalysisFormHandler.php(77): Drupal\yoast_seo\EntityAnalyser->createEntityPreview()
#2 [internal function]: Drupal\yoast_seo\Form\AnalysisFormHandler->analysisSubmitAjax()
#3 /var/www/html/docroot/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php(69): call_user_func_array()
#4 /var/www/html/docroot/core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php(109): Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse()
#5 [internal function]: Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber->onException()
#6 /var/www/html/docroot/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#7 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(227): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#8 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(79): Symfony\Component\HttpKernel\HttpKernel->handleException()
#9 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle()
#10 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle()
#11 /var/www/html/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#12 /var/www/html/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#13 /var/www/html/docroot/modules/contrib/shield/src/ShieldMiddleware.php(91): Drupal\page_cache\StackMiddleware\PageCache->handle()
#14 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\shield\ShieldMiddleware->handle()
#15 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#16 /var/www/html/docroot/modules/contrib/remove_http_headers/src/StackMiddleware/RemoveHttpHeadersMiddleware.php(49): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#17 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle()
#18 /var/www/html/docroot/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle()
#19 /var/www/html/docroot/index.php(19): Drupal\Core\DrupalKernel->handle()

Did i messed some configurations
Thanks

CommentFileSizeAuthor
#5 3204291-5.patch1.08 KBbatigolix
#4 3204291-4.patch1.04 KBstrykaizer
#3 3204291-1.patch918 bytesmarckwee

Comments

medwassim created an issue. See original summary.

medwassim’s picture

Issue summary: View changes
marckwee’s picture

StatusFileSize
new918 bytes

Hi medwassim,

I ran into the same issue and created a small patch.

Hope this helps you out =)!

strykaizer’s picture

Status: Active » Needs review
StatusFileSize
new1.04 KB

Same issue when using yoast on user entities.
Added extra check.

batigolix’s picture

StatusFileSize
new1.08 KB

I had to change the patch to make it apply to the latest 2.0 alpha version

bramdriesen’s picture

Status: Needs review » Reviewed & tested by the community

This solved the issue for me on taxonomy term edit pages!

bramdriesen’s picture

Version: 8.x-2.0-alpha6 » 8.x-2.x-dev

  • Kingdutch committed 88bc4dae on 8.x-2.x
    Issue #3204291 by MarcKwee, StryKaizer, batigolix, medwassim,...

  • Kingdutch committed 6d251c74 on 8.x-2.x
    Add taxonomy term test coverage
    
    This reveals a bug which was file in #...
kingdutch’s picture

Status: Reviewed & tested by the community » Fixed

This has been fixed on 8.x-2.x-dev

I opted for using label instead of using the method_exists check. For Terms and Node's the label call is equivalent to using their respective get* method. Additionally the label method is available on the EntityInterface so we can be sure it's always available.

I've added a Behat test to make sure the RTSEO module works on Terms, similar to what was already present for Nodes (that test also properly demonstrated the bug).

GitLab CI support for Behat is still a work in progress.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.