Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

silverstripe blog update "there are two files containing the "blogentry" class"


Go to End


7 Posts   2328 Views

Avatar
Guy Van Bael

Community Member, 61 Posts

25 March 2015 at 8:47pm

Hi,

On my local MAMP stack, i ran composer update, did a dev build an all was ok. Since i don't have composer on my shared hosting. I usually deploy my code with the synchronise function of APTANA (the ide i use). Never had any problems with this (there are about 80 websites that i manage). Now when i synchronise and do a dev build on the live server i get this "there are two files containing the "blogentry" class...." Database doesn't get build. Manually removing these duplicate php files (which do exist on my local MAMP stack too without any problem) solves the problem and makes the site accesiible again, but the blog module is not updated.

Can anybody help me out.
Thanks. Guy

Avatar
Pyromanik

Community Member, 419 Posts

26 March 2015 at 12:26am

Could be differences in PHP version causing that.
It used to be an issue in 2.4 - but the 3.x manifest works differently & two conflicting classes became less of an issue.

Finding out why composer has put two classes of the same thing is probably the more pertinent issue.
Perhaps you've accidentally installed both blog (old 'official') and blogger (new 'official')?

Avatar
Guy Van Bael

Community Member, 61 Posts

26 March 2015 at 1:48am

Thanks for your reply Pyromanik.
I checked the PHP version. On my local machine it's 5.3, on the live server it's 5.4.
Is there something i can do besides reverting the live server to Php 5.3?

Avatar
Pyromanik

Community Member, 419 Posts

26 March 2015 at 1:59am

I said 'could be' ;) I'm not sure. It could be a configuration issue...

Did you check composer isn't pulling in both blog modules?

Avatar
Guy Van Bael

Community Member, 61 Posts

26 March 2015 at 3:00am

Edited: 26/03/2015 3:15am

No, it's just pulling in "silverstripe/blog": "*" ... and if i change the php version on my mamp stack to php5.4, it's giving me the same error. Reverting it back solves the problem, but i guess there must be another option to solve this too.

Avatar
JonoM

Community Member, 130 Posts

28 March 2015 at 5:58am

You said there are duplicate PHP files so the error does seem valid - so as Pyromanik pointed out it's probably better to focus on working out why those duplicate files are showing up rather than which version of PHP throws an error. What are the files called that contain the duplicate files? Can you find them both if you browse the code at github?

It seems like you're not ending up with the right set of files installed for that module. Maybe try clearing your Composer cache https://getcomposer.org/doc/03-cli.md#clear-cache and updating again? And if that doesn't help, maybe try downloading the module directly from github and installing that way?

Avatar
Guy Van Bael

Community Member, 61 Posts

30 March 2015 at 11:41pm

Thanks for the replies y'all!
I solved it by first deleting the blog module (using composer) on my dev version. Then i updated the live site. At that point, there was no blog anymore.
Next, i added the blog module again (using composer) on my dev version, synchronised with my live site and everything is working again.

I don't know exactly what went wrong earlier. My guess is that some files weren't deleted on the live site when syncing the first time and were "synced back" to my development version.