backdrop-contrib / metatag

Add structured metadata, aka "meta tags", for various pages on your site.
GNU General Public License v2.0
3 stars 15 forks source link

Cannot redeclare metatag_views_views_plugins() (previously declared in ../modules/metatag/metatag_views/metatag_views.module:21) in ...modules/metatag/metatag_views/metatag_views.views.inc on line 21 #67

Closed jpablusco closed 2 years ago

jpablusco commented 3 years ago

When trying to install Metatag Views module I get this error: Cannot redeclare metatag_views_views_plugins() (previously declared in ../modules/metatag/metatag_views/metatag_views.module:21) in ...modules/metatag/metatag_views/metatag_views.views.inc on line 21 The function is in both files.

laryn commented 2 years ago

I just saw this, too.

yorkshire-pudding commented 2 years ago

I just got this trying to update to 1.22.2

indigoxela commented 2 years ago

Exactly the same function got added twice:

https://github.com/backdrop-contrib/metatag/blob/1.x-1.x/metatag_views/metatag_views.module#L20

https://github.com/backdrop-contrib/metatag/blob/1.x-1.x/metatag_views/metatag_views.views.inc

And now I see the connection to core: A bug with views file inclusion got fixed in 1.22.1: https://github.com/backdrop/backdrop-issues/issues/5512

So this double function declaration causes problems now. Previously the path has been ignored.

The solution is to remove the declaration in metatag_views.module#L20

indigoxela commented 2 years ago

A PR is available for testing and review.

Ping @jenlampton

yorkshire-pudding commented 2 years ago

I've tested on the local that had the issue and re-enabled metatag_views and it's fine. I've also tested the update on another site with metatag and it works there too.

quicksketch commented 2 years ago

@jenlampton merged in https://github.com/backdrop-contrib/metatag/pull/86 and I made a follow-up commit in https://github.com/backdrop-contrib/metatag/commit/3f0f9928c42256839dde2f206b1c384e51e6a902. Thanks folks!