mishellnovosel / craft3-timediff

Adds the Twig Date extension to the Craft3 CMS
0 stars 1 forks source link

Can't load plugin #1

Open bstein-clever opened 5 years ago

bstein-clever commented 5 years ago

Migrating from the conversation here: https://github.com/mildlygeeky/craft-timediff/issues/2 I still can't install this plugin from inside the Control Panel.

It's basically the same error as before, just with an _ instead of a -, to match your change: PHP Fatal error: Cannot declare class codecacao\time_diff\TimeDiffPlugin, because the name is already in use in <plugin_dir>/timediff/src/TimeDiffPlugin.php on line 0

bstein-clever commented 5 years ago

I spent a bit more time fighting with this just now, and I think it was a package name thing, as you focused on. I'm just not sure why you're keeping the codecacao. When I made it all consistent: https://github.com/bstein-clever/craft3-timediff/commit/dc7c6aaf6685b0acb6ca83753d31d3554a5055db I was able to get it to install. I can't push to your repo as a branch, so I'll let you handle merging it, and/or altering it to your liking.

I also found a bug in the actual code - when I tried to use the diff code, it always displayed year ago. Comparing with the original, I think you want this diff: https://github.com/bstein-clever/craft3-timediff/commit/d4bce873e1014dcc7158c4392585ac4b86b76cb8

It's not clear to me why you switched to \DateTime, or if there's a benefit from that.

mishellnovosel commented 5 years ago

Hi @bstein-clever, sorry I wasn't been able to respond so far. I'm aware it is naming issue, but seems like I forgot to change it on all places. Thanks for pointing it out for me. I'll be sure to update it.

I'm glad you were able to get it working for you :)