Git Product home page Git Product logo

Comments (24)

nathanhornby avatar nathanhornby commented on August 16, 2024

Actually I think that the cache is active when I'm logged in, which is likely what's causing the above. If I understand the intended function correctly it should be ignoring the cache if I'm logged in.

from cachelite.

andrewminton avatar andrewminton commented on August 16, 2024

Yep. Cache should not be active if you are logged in.

Try editing this line:

https://github.com/symphonists/cachelite/blob/master/extension.driver.php#L254

to:

$logged_in = isset(Frontend::instance()->Author());

Accessing Author was changed recently me thinks.

from cachelite.

nitriques avatar nitriques commented on August 16, 2024

Accessing Author was changed recently me thinks.

Exactly. See https://github.com/symphonycms/symphony-2/wiki/Migration-Guide-to-2.5-for-Developers#properties for the migration path.

from cachelite.

bzerangue avatar bzerangue commented on August 16, 2024

+1 Experiencing the same problem. Any fixes known?

@andrewminton - your suggested change above generates the follow Fatal Error...

Fatal error: Cannot use isset() on the result of a function call (you can use "null !== func()" instead) in /sites/public/extensions/cachelite/extension.driver.php on line 255

Also, I try the suggested change in the Fatal error to change it to "null !== Frontend::instance()->Author();" and that doesn't work either.

from cachelite.

brendo avatar brendo commented on August 16, 2024

Try Symphony::Author(). Am I right you are running PHP 5.5+? Is this the first time you have used the extension running that?

from cachelite.

nathanhornby avatar nathanhornby commented on August 16, 2024

I was most likely using 5.3

On 3 Oct 2014, at 00:01, Brendan Abbott [email protected] wrote:

Try Symphony::Author(). Am I right you are running PHP 5.5+? Is this the first time you have used the extension running that?


Reply to this email directly or view it on GitHub.

from cachelite.

brendo avatar brendo commented on August 16, 2024

$logged_in = Symphony::isLoggedIn();

from cachelite.

bzerangue avatar bzerangue commented on August 16, 2024

I am running PHP 5.5. I tried...

$logged_in = Symphony::isLoggedIn();

and it still breaks ?debug; when I disable the extension... ?debug works.

from cachelite.

nitriques avatar nitriques commented on August 16, 2024

Can you try var_dump'ing the $logged_in value ?

from cachelite.

bzerangue avatar bzerangue commented on August 16, 2024

Can you try var_dump'ing the $logged_in value ?

It returns bool(true)

from cachelite.

nitriques avatar nitriques commented on August 16, 2024

This is weird...

from cachelite.

nitriques avatar nitriques commented on August 16, 2024

Are you entering this if ?

https://github.com/symphonists/cachelite/blob/master/extension.driver.php#L268

from cachelite.

bzerangue avatar bzerangue commented on August 16, 2024

Are you entering this if ?

https://github.com/symphonists/cachelite/blob/master/extension.driver.php#L268

I put a var_dump($logged_in) inside that if and nothing runs... so it doesn't look like it is entering that if

from cachelite.

nitriques avatar nitriques commented on August 16, 2024

So you're not getting the cache then... Looks like a delegate mixup...

Can you try to:

  1. Disable Cachelite, confirm that ?debug is working...
  2. Enable Cachelite, confirm that ?debug is not working...
  3. Enable Debug Devkit even if it is enabled already ?

from cachelite.

nitriques avatar nitriques commented on August 16, 2024

Never mind, they do not even share any delegates... https://github.com/symphonycms/debugdevkit/blob/master/extension.driver.php#L10

from cachelite.

bzerangue avatar bzerangue commented on August 16, 2024

I did try that. But no go.

Also, just to confirm, my comment where I say that var_dump($logged_in); returns bool(true), that is with $logged_in = Symphony::isLoggedIn();

When $logged_in = isset(Frontend::instance()->Author); and running var_dump($logged_in); nothing outputs.

from cachelite.

nitriques avatar nitriques commented on August 16, 2024

Can/did you try to change isset(Frontend::instance()->Author); with Symphony::isLoggedIn(); everywhere ?

https://github.com/symphonists/cachelite/blob/master/extension.driver.php#L254
https://github.com/symphonists/cachelite/blob/master/extension.driver.php#L324

from cachelite.

bzerangue avatar bzerangue commented on August 16, 2024

Can/did you try to change isset(Frontend::instance()->Author); with Symphony::isLoggedIn(); everywhere ?

https://github.com/symphonists/cachelite/blob/master/extension.driver.php#L254
https://github.com/symphonists/cachelite/blob/master/extension.driver.php#L324

Uggh! I missed line 324. That was it!

I replaced isset(Frontend::instance()->Author); with Symphony::isLoggedIn(); everywhere

It is working!

from cachelite.

andrewminton avatar andrewminton commented on August 16, 2024

So is ::isLoggedIn (); in itself accessing Symphony::Author () then?

from cachelite.

nitriques avatar nitriques commented on August 16, 2024

@bzerangue Great! I'll re-open the issue and add the proper fix in the code! Thanks!

@andrewminton Yes, for sure: https://github.com/symphonycms/symphony-2/blob/master/symphony/lib/core/class.symphony.php#L583

from cachelite.

brendo avatar brendo commented on August 16, 2024

So is ::isLoggedIn (); in itself accessing Symphony::Author () then?

Yes. In a more sustainable way. This is the correct function to verify that an Author is logged in.

from cachelite.

andrewminton avatar andrewminton commented on August 16, 2024

Ok thanks @brendo

from cachelite.

brendo avatar brendo commented on August 16, 2024

So @nitriques, isn't there a fix already for this judging by the comments?

from cachelite.

nitriques avatar nitriques commented on August 16, 2024

isn't there a fix already for this judging by the comments?

An untested one, yes.

EDIT: untested = I've personally not tested it.

from cachelite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.