hschottm / tags

Contao tags extension
11 stars 16 forks source link

Issue with one news list + one eventlist on the same page when using Tags #12

Closed JLBA closed 9 years ago

JLBA commented 9 years ago

Hi Helmut,

On the same page, I need to use an eventlist module and a newslist module. Without Tags, everything works fine. With Tags installed, if only one module has items to show, it works fine. But if both modules have items to show, I got the blank page with error : "Fatal error: Cannot redeclare class Contao\TagHelper in /Applications/MAMP/htdocs/PCSL/system/modules/tags/classes/TagHelper.php on line 393".

In Contao's settings, I have checked to deactivate tags for news, articles and content. I also tried checking "Ignore tags" in newslits module but no way.

What's the solution please ?

Thanks.

hschottm commented 9 years ago

Hi,

works fine for me with tags 3.2.2 installed on Contao 3.2.15 tags 3.3.0 is explicitly marked as compatible with Contao 3.3 and higher. You need to use tags 3.2.2 which is made for Contao 3.2.x I am not even able to install tags 3.3.0 on a Contao 3.2.x installation using the extension repository.

JLBA commented 9 years ago

Thanks. I've just donwgraded with Tags 3.2.2 but no more. I'll try upgrading Contao in 3.2.15 and come back.

hschottm commented 9 years ago

Must be some problem with module imports. It's these f***ing Contao namespaces. Please give me a list of all modules that you have installed on that page. I will install them all and see if the combination of modules causes this problem. Without reproducing this issue I am not able to fix it.

JLBA commented 9 years ago

Ok. Just upgraded to Contao 3.2.15 but no more.

The modules : In the page layout Custom HTML - Header Custom navigation - Header Custom HTML - Footer

In article - Main column EventList Newslist

JL Test jltest@free.fr

Le 19 nov. 2014 à 11:27, Helmut Schottmüller notifications@github.com a écrit :

Must be some problem with module imports. It's these f***ing Contao namespaces. Please give me a list of all modules that you have installed on that page. I will install them all and see if the combination of modules causes this problem. Without reproducing this issue I am not able to fix it.

— Reply to this email directly or view it on GitHub.

hschottm commented 9 years ago

No, I mean all installed modules of your Contao installation. There must be a problem with some modules interfering with each other. I don't think that it has to do with the modules on the page. Otherwise it wouldn't work on my installation.

bildschirmfoto 2014-11-19 um 12 47 45

Like this.

Cheers, Helmut

JLBA commented 9 years ago

There it is. Some were installed for test and aren’t used.

JL Test jltest@free.fr

Le 19 nov. 2014 à 12:48, Helmut Schottmüller notifications@github.com a écrit :

No, I mean all installed modules of your Contao installation. There must be a problem with some modules interfering with each other. I don't think that it has to do with the modules on the page. Otherwise it wouldn't work on my installation.

Like this.

Cheers, Helmut

— Reply to this email directly or view it on GitHub.

hschottm commented 9 years ago

Did you send a screenshot? If yes, nothing was sent.

JLBA commented 9 years ago

Sorry. Here it is… again…

JL Test jltest@free.fr

Le 19 nov. 2014 à 16:09, Helmut Schottmüller notifications@github.com a écrit :

Did you send a screenshot? If yes, nothing was sent.

— Reply to this email directly or view it on GitHub.

hschottm commented 9 years ago

Nothing here. Can you maybe send it to me via email? hschottm@gmail.com

hschottm commented 9 years ago

Added all the modules you have into my installation. Use a page with an event list and a news list. Both have output. No error message. I am using a clean installation, maybe something went wrong with an update. You could try to remove the tags extension, but not the tables and then reinstall it. Maybe this helps?

There is a thread in the german contao forum. Someone just changed the sequence of news list and events list and then it worked. I don't know what to do because without having that error I cannot analyze what's going on.

Cheers, Helmut

JLBA commented 9 years ago

Hi Helmut,

I was thinking about a bug in my installation so I did first reinstall tags with old tables then recreating tables but no way.

So am I testing with a clean installation with new db. And the mystery is growing :

If newslist module is placed before event module -> works If event module is placed before newslist module -> fatal error…TagHelper…on line 393. If one newslist then the eventlist then a duplicated newslist -> works. So I could hide the first one as said in the post in the german forum but that’s not a very clean way…

Newslist module was ID 1. Event Module was ID 2. I suppressed Newslist module and recreated it for it has ID 3. Changes nothing.

I’ve recreated the two content elements in my article : first the newslist then the eventlist -> works. If I switch them in the article -> Fatal error… bla bla bla

I’ve just tested on my actual dev site: the same. With newslist (or one newslist) first -> works.

What’s your opinion ?

JL Test jltest@free.fr

Le 19 nov. 2014 à 17:35, Helmut Schottmüller notifications@github.com a écrit :

Added all the modules you have into my installation. Use a page with an event list and a news list. Both have output. No error message. I am using a clean installation, maybe something went wrong with an update. You could try to remove the tags extension, but not the tables and then reinstall it. Maybe this helps?

There is a thread in the german contao forum. Someone just changed the sequence of news list and events list and then it worked. I don't know what to do because without having that error I cannot analyze what's going on.

Cheers, Helmut

— Reply to this email directly or view it on GitHub.

JLBA commented 9 years ago

Hi again,

There was a new answer on the german forum :

Das Problem ist, dass der Contao Autoloader einen Bug hat, den Leo nicht in der 3.2.x gefixt hat.

Das Problem tritt auf, wenn eine Klasse einmal mit Contao\ClassName und einmal mit \ClassName in einer bestimmten Reihenfolge geladen wird.

Anscheinend wird dies bei der tags Erweiterung gemacht. Als fix kann die tags Erweiterung immer \TagHelper verwenden.

Oder ihr schafft es Leo dazu zu bringen folgenden commit endlich ins die LTS zu backporten.

https://github.com/contao/core/commi...0efe6899504a1b

JL Test jltest@free.fr

Le 20 nov. 2014 à 11:31, JL Test jltest@free.fr a écrit :

Hi Helmut,

I was thinking about a bug in my installation so I did first reinstall tags with old tables then recreating tables but no way.

So am I testing with a clean installation with new db. And the mystery is growing :

  • only one simple page (inside the root one of course) and one article
  • only one calendar archive with only one event
  • only one news archive with only one news
  • only one newslist module and only one eventlist module.
  • nothing else than this two modules in the article (no menu…)

If newslist module is placed before event module -> works If event module is placed before newslist module -> fatal error…TagHelper…on line 393. If one newslist then the eventlist then a duplicated newslist -> works. So I could hide the first one as said in the post in the german forum but that’s not a very clean way…

Newslist module was ID 1. Event Module was ID 2. I suppressed Newslist module and recreated it for it has ID 3. Changes nothing.

I’ve recreated the two content elements in my article : first the newslist then the eventlist -> works. If I switch them in the article -> Fatal error… bla bla bla

I’ve just tested on my actual dev site: the same. With newslist (or one newslist) first -> works.

What’s your opinion ?

JL Test jltest@free.fr

Le 19 nov. 2014 à 17:35, Helmut Schottmüller notifications@github.com a écrit :

Added all the modules you have into my installation. Use a page with an event list and a news list. Both have output. No error message. I am using a clean installation, maybe something went wrong with an update. You could try to remove the tags extension, but not the tables and then reinstall it. Maybe this helps?

There is a thread in the german contao forum. Someone just changed the sequence of news list and events list and then it worked. I don't know what to do because without having that error I cannot analyze what's going on.

Cheers, Helmut

— Reply to this email directly or view it on GitHub.

hschottm commented 9 years ago

Well,

to be honest, I never understood this namespace stuff that Contao uses. I changed everything to Contao\Classname because there have been many errors like this in the past. I am a bit anxious if I now change it back to \Classname but I will try. I run some tests and hope that it works.

Cheers, Helmut

JLBA commented 9 years ago

Ok. Thanks. What is the purpose of namespaces ?

JL Test jltest@free.fr

Le 20 nov. 2014 à 16:45, Helmut Schottmüller notifications@github.com a écrit :

Well,

to be honest, I never understood this namespace stuff that Contao uses. I changed everything to Contao\Classname because there have been many errors like this in the past. I am a bit anxious if I now change it back to \Classname but I will try. I run some tests and hope that it works.

Cheers, Helmut

— Reply to this email directly or view it on GitHub.

hschottm commented 9 years ago

Basically it is meant to be able to replace objects in a certain namespace by own objects that you develop in your custom module. But from my perspective this never worked. Well it's necessary since Contao 3.0 so there wasn't a choice to omit it. I will test this in the evening and if it works commit a new version to the tags repository so you can test it.

hschottm commented 9 years ago

I checked it in the german forum. Currently I am not sure what I should change in tags to make it work as suggested. But judging from the forum entry it seems like a bug in Contao 3.2 LTS. As soon as I don't know how to fix this without changing the complete module (removing all namespace definitions which I really don't like to do because in all my other modules I am using these namespaces too because without I had other problems) I will not do any changes to the module.

JLBA commented 9 years ago

Hi,

I think you're right too. I haven't yet tested the bugfix but if it worked, my problem is that it can be suppressed by any core update. Do you think it's possible to make it as a plugin which won't be updated or could be deactivated if necessary. If yes, could you help me in as I'm not a php developper. Thanks.

JL Barts-Andreetto

Le 21 nov. 2014 à 10:02, Helmut Schottmüller notifications@github.com a écrit :

I checked it in the german forum. Currently I am not sure what I should change in tags to make it work as suggested. But judging from the forum entry it seems like a bug in Contao 3.2 LTS. As soon as I don't know how to fix this without changing the complete module (removing all namespace definitions which I really don't like to do because in all my other modules I am using these namespaces too because without I had other problems) I will not do any changes to the module.

— Reply to this email directly or view it on GitHub.

hschottm commented 9 years ago

There's no way to do this fix as a plugin. I didn't try to apply the suggested fix because it would have no effect on my system since I don't have the problem with the modules, so I can't even tell you if the suggested fix will work.

JLBA commented 9 years ago

Ok. I could update to Contao 3.3 if other plugins work with it. But it's not LTS.

Or I'll put a post-it somewhere to remember ;) There should be somewhere in Contao to let devs annotate suchs informations.

Thanks for your time and help.

JL Barts-Andreetto

Le 21 nov. 2014 à 11:04, Helmut Schottmüller notifications@github.com a écrit :

There's no way to do this fix as a plugin. I didn't try to apply the suggested fix because it would have no effect on my system since I don't have the problem with the modules, so I can't even tell you if the suggested fix will work.

— Reply to this email directly or view it on GitHub.

JLBA commented 9 years ago

Hi Helmut,

For information, I’ve tested the bugfix under 3.2 and it works. So the only way is to convince Leo to fix it in an further update.

Thanks.

JL Test jltest@free.fr

Le 21 nov. 2014 à 11:04, Helmut Schottmüller notifications@github.com a écrit :

There's no way to do this fix as a plugin. I didn't try to apply the suggested fix because it would have no effect on my system since I don't have the problem with the modules, so I can't even tell you if the suggested fix will work.

— Reply to this email directly or view it on GitHub.

hschottm commented 9 years ago

I fixed it. Had a wrong initialization of the TagHelper class

JLBA commented 9 years ago

It seems to work. Thanks.

JL Test jltest@free.fr

Le 15 déc. 2014 à 01:29, Helmut Schottmüller notifications@github.com a écrit :

I fixed it. Had a wrong initialization of the TagHelper class

— Reply to this email directly or view it on GitHub.