In some cases this line:

$this->request->attributes->get('taxonomy_term')

will not return a term object but just a taxonomy term ID. For example if we have a View with contextual filter.

So, lets handle that case as well.

Comments

gnikolovski created an issue. See original summary.

gnikolovski’s picture

Assigned: Unassigned » gnikolovski
Status: Active » Fixed

  • gnikolovski committed e62b93b on 8.x-1.x
    Issue #3050842 by gnikolovski: Taxonomy term not always an object
    

Status: Fixed » Closed (fixed)

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