Giter Site home page Giter Site logo

Comments (6)

robertem128 avatar robertem128 commented on June 14, 2024

Looking further into this, I'm not sure if there is a bug or an issue with OSX and time conversions but var dumping the meta data is changing the date to 4 hours ahead (ex. 2017-07-21 20:03:44 vs db value of 2017-07-21 16:03:44). I tried changing time zones but it had no effect. I've been developing in Laravel but have little experience with Slim but will keep looking for an answer.

from leafpub.

karsasmus avatar karsasmus commented on June 14, 2024

Hi @robertem128 ,
thanks for posting.
Leafpub saves the local date in UTC format to the database (https://github.com/Leafpub/leafpub/blob/master/app/source/classes/Leafpub.php#L345)
and converts the database date, which is in UTC format, to local format
(https://github.com/Leafpub/leafpub/blob/master/app/source/classes/Leafpub.php#L830)

I tested a clean installation of Leafpub 1.1.9 and I was able to open an author post with an admin/editor user, so I can't reproduce this strange bug 🙁
On line 275 of AdminController, there's the check for owner/admin/editor

from leafpub.

robertem128 avatar robertem128 commented on June 14, 2024

Thanks @karsasmus,
I did see those but I think there is something else going on in my case. I had tried comment out the code in both functions before I posted with the same results. I have also verified my timezone settings in both PHP and the app. I'm going to try a fresh install on both my local and a DO LAMP and see if I can track it down what's happening. It's very possible that the problem is in my local setup but I have not seen this behavior on any of the apps that I have wrote.

from leafpub.

robertem128 avatar robertem128 commented on June 14, 2024

I was able to resolve the issue by changing the getPostMeta function on post.php. the problem I was experiencing was related to the time change in that the setting of the post meta 'lock' is not converting the time to UTC so the page was not accessible for 1 day + 4 hours (in my timezone).

I replaced
$time = strtotime($ret['lock'][1]);
with
$time = strtotime(Leafpub::utcToLocal($ret['lock'][1]));

and now everything works as expected.

Thanks,
Rob

from leafpub.

karsasmus avatar karsasmus commented on June 14, 2024

Thank you for finding and fixing the bug, @robertem128 👍

from leafpub.

JohnnySix avatar JohnnySix commented on June 14, 2024

Stupid question, but it appears this is commented out from post.php in the new version, presume this function is now obsolete, however, I still have issues where a draft can't be published and/or doesn't save after the 'first' save. I've written whole posts, hit save, and the progress bar/message doesn't display.

This is all within a few seconds, so should still be under same session.

from leafpub.

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.