Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEED issue with 3.6.1 #1028

Closed
ptdev opened this issue Apr 4, 2017 · 7 comments
Closed

SEED issue with 3.6.1 #1028

ptdev opened this issue Apr 4, 2017 · 7 comments
Labels

Comments

@ptdev
Copy link
Contributor

ptdev commented Apr 4, 2017

Hi guys, just updated some apps to 3.6.1 and noticed an issue.

Before upgrading, I had a SEED set (say: myseed) and my cache entries were saved like:

myseed.2fiubxqhv1a8c.url

After the upgrade my cache entries are getting saved as:

1.2fiubxqhv1a8c.url

Can anybody else confirm this? Thanks

EDIT: using php 7.1 and APCu cache engine

EDIT 2: The issue seems to be at line 2614.

This line:
$this->prefix=$seed?:$fw->SEED;

If I change it to:

$this->prefix=$fw->SEED;

It fixes the issue. I saw on the changelog something regarding a more flexible "SEED" but didn't really get what changes were made or if any changes are required on the code on our end.
Looking at that line I have to say I don't really get what that's doing. If there's a $seed, then set prefix to nothing? Otherwise use the hive's seed?

@KOTRET
Copy link
Collaborator

KOTRET commented Apr 4, 2017

the ternary reads like "if $seed is "truely" (not falsy) then use it, otherwise use $fw->SEED".
So an empty string, number 0, the value null or boolean false are resulting in using $fw->SEED.
Imho commit f3-factory/fatfree-core@de79e0e cannot be responsible for that

@ptdev
Copy link
Contributor Author

ptdev commented Apr 4, 2017

"if $seed is falsy then use $fw->SEED, otherwise use $seed"

Wouldn't that be
$this->prefix=$seed?$seed:$fw->SEED;
?

@xfra35
Copy link
Collaborator

xfra35 commented Apr 4, 2017

The ternary is correct. But there's an issue with this line.

Looks like a remnant from an old version.

@xfra35
Copy link
Collaborator

xfra35 commented Apr 4, 2017

$seed?:$fw->SEED is a shorthand for $seed?$seed:$fw->SEED so the string would be used.

@ptdev
Copy link
Contributor Author

ptdev commented Apr 4, 2017

Oops, you're right, since php 5.3 apparently so I'm way late to this party! Learn something everyday 👍

Anyway, my initial issue still stands though. Have you been able to confirm you also get the prefix behavior I mentioned on my first post?

xfra35 added a commit to f3-factory/fatfree-core that referenced this issue Apr 4, 2017
@xfra35
Copy link
Collaborator

xfra35 commented Apr 4, 2017

@ptdev should be fixed in https://github.com/bcosca/fatfree-core now.

@xfra35 xfra35 added the bug label Apr 4, 2017
@xfra35 xfra35 closed this as completed Apr 4, 2017
@ptdev
Copy link
Contributor Author

ptdev commented Apr 4, 2017

Great, thanks @xfra35
I hope this gets merged into 3.6.1-Release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants