rluders / wn-jwtauth-plugin

JWTAuth Plugin for WinterCMS
GNU General Public License v3.0
29 stars 28 forks source link

Carbon Error on Plugin Installation #22

Closed danielbruni closed 5 years ago

danielbruni commented 5 years ago

Iam getting the following Error on a fresh October Installation with Apache and PHP 7.1 and 7.2:

Declaration of Jenssegers\Date\Date::add($interval) must be compatible with Carbon\CarbonInterface::add($unit, $value = 1, $overflow = NULL)

rluders commented 5 years ago

That's is weird, but... Do not seems to be related to my plugin. I don't remember to use this dependency.

Can you provide more details about your installation?

On Mon, Mar 4, 2019, 18:07 Daniel-Bruni Ziermann <notifications@github.com wrote:

Iam getting the following Error on a fresh October Installation with Apache and PHP 7.1 and 7.2:

Declaration of Jenssegers\Date\Date::add($interval) must be compatible with Carbon\CarbonInterface::add($unit, $value = 1, $overflow = NULL)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rluders/oc-jwtauth-plugin/issues/22, or mute the thread https://github.com/notifications/unsubscribe-auth/AALqMw16sTYdgB1HtA6snm692schyqnVks5vTVLPgaJpZM4bczJb .

danielbruni commented 5 years ago

Thanks for the quick reply. Just made a new Octobercms install on my server and was trying to install your plugin (no other plugins installed) and during the installation process this error shows up.

There is a nesbot/carbon in your plugins vendors folder. Iam using OctoberCMS 447 and 448. jenssegers/date seems to be a october requirement. Maybe there is a date-carbon version conflict.

rluders commented 5 years ago

Ok. I'll check it out when I get home.

On Mon, Mar 4, 2019, 18:19 Daniel-Bruni Ziermann <notifications@github.com wrote:

Thanks for the quick reply. Just made a new Octobercms install on my server and was trying to install your plugin (no other plugins installed) and during the installation process this error shows up.

There is a nesbot/carbon in your plugins vendors folder. Iam using OctoberCMS 448.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rluders/oc-jwtauth-plugin/issues/22#issuecomment-469337782, or mute the thread https://github.com/notifications/unsubscribe-auth/AALqM8YZjvy7ne1jFXZz307zlCKBXT9Tks5vTVWogaJpZM4bczJb .

rluders commented 5 years ago

Looks like we have two packages colliding. The first one is installed by the OctoberCMS Library and the second one is being installed by the tymon/jwt-auth, causing an conflict between two Carbon versions.

At this point I have no idea how to solve it. I need to investigate.

rluders commented 5 years ago

Just adding one more extra information... Looks like the real issue is related to 'jenssegers/date' that is using an outdated Carbon version. So, I was looking the repository and it seems a little bit abandoned for me... in this case, I'll try to submit a PR to update it's dependencies.

rluders commented 5 years ago

OK. I'll try something else during this week, my initial aproach seems to be more complicated. So, it was working before, maybe I just need to 'downgrade' a version of the tymon/jwt-auth library that I'm using.

rluders commented 5 years ago

Just one workarround that could help for now:

The issue only ocurres if you run OctoberCMS over PHP 7.1+, so, if you downgrade your PHP to 7.0 it should be fine. It's not a solution, it's just an workarround while I'm working to fix it.

sandyandi commented 5 years ago

@rluders can you please create a version of your plugin that use tymon/jwt-auth version 1.0.0-rc.3 instead of the latest version (1.0.0-rc.4)? rc3 doesn't have Carbon 2.

It makes sense to do so as your plugin is made for October CMS which doesn't support Carbon 2 yet.

rluders commented 5 years ago

Actually, I'm doing this. Just need to test it before release.

On Wed, Mar 13, 2019, 00:28 Sandyandi N. dela Cruz notifications@github.com wrote:

@rluders https://github.com/rluders can you please create a version of your plugin that use tymon/jwt-auth version 1.0.0-rc.3 instead of the latest version (1.0.0-rc.4)? rc3 doesn't have Carbon 2.

It makes sense to do so as your plugin is made for October CMS which doesn't support Carbon 2 yet.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rluders/oc-jwtauth-plugin/issues/22#issuecomment-472219987, or mute the thread https://github.com/notifications/unsubscribe-auth/AALqM5E5-TkFlaWRcqXS3P6hrWZ6ugVZks5vWDghgaJpZM4bczJb .

rluders commented 5 years ago

I posted today a patch, that downgrade the tymon/jwt-auth library to avoid the issues with Carbon. In my tests it worked fine (but, since I don't have unit tests for this plugin yet), if someone find something wrong, please, let me know.

It is possible that you need to remove the plugin and install it again.