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

Changes made to markdown file isn't showing up in the browser. #38

Closed
ofisia opened this issue Aug 28, 2014 · 18 comments
Closed

Changes made to markdown file isn't showing up in the browser. #38

ofisia opened this issue Aug 28, 2014 · 18 comments
Labels

Comments

@ofisia
Copy link

ofisia commented Aug 28, 2014

I know the official documentation recommended LightPaper for editing markdown files, but since I'm not accustomed to it, I tried editing the markdown files using other code editors.

Surprisingly, changes made using those code editor aren't showing up in the browser (Chrome/Firefox), I even tried clearing the browser everytime I'm previewing but the problem persist. The only way to have the browser reflect the changes is by opening and re-saving the markdown files using LightPaper.

Those code editors are:

  • Atom
  • Brackets
  • Dreamweaver
  • Komodo Edit
  • SeaMonkey
  • TextWrangler

Encoding-related issue?

@schurb
Copy link

schurb commented Aug 28, 2014

I have the same problem, which I can solve by deleting everything in /cache/

@bobrocke
Copy link

Grav caching bug, or intended behavior?

@rhukster
Copy link
Member

Ok please try a couple of things:

  1. re-save your user/config/system.yaml file. This should manually trigger Grav that a cache-flush is needed
  2. If that doesn't work - try from the terminal in grav root: bin/grav clear-cache
  3. If that is still not working, try turning off the cache temporarily in user/config/system.yaml

Please let me know which of these options worked for you, that will help determine what's going on.

Cheers!

@schurb
Copy link

schurb commented Aug 28, 2014

I will make some tests tomorrow. I have a feeling where the problem is.

@sthag
Copy link

sthag commented Aug 28, 2014

I experienced the same problem. It seems to have nothing to do with editors or encoding.
The problem seems to be that grav doesn't recognize the changes made to the file because the directory, the file is in, isn't updated.
The clear-cache command helped but I got a hint to update the directory time to the last file change and this did the trick.
I use a guest virtual machine running ubuntu server 14.04.1
It runs with apache 2.4.7 and php 5.5.9
Grav is version 0.9.0
The host is a Windows 8.1 machine and is sharing a directory with the guest which lies in the apache webroot. So grav is on an ntfs filesystem. The timestamps are correct on both machines. But the directories don't change on file changes within.

I was asked to do a change within the file system/src/Grav/Common/Filesystem/Folder.php
I changed getMTime() to getCTime()
Unfortunately this did not change the behaviour.
I cleared the cache of the browser and did a hard reload.
Changed a file.
Did a reload.
No change.

Ran touch . within the directory of the file on the guest system.
Did a browser reload.
Change visible.

@rhukster
Copy link
Member

I have updated the develop branch with a new method (that is enabled by default) to find changes by 'file' modification dates rather than by 'folder`. If you guys are up to it, can you try cloning and installing the github version and letting me know if that helps?

@schurb
Copy link

schurb commented Aug 29, 2014

I'm on it. Hang on.

Okay, here is my observation:
I am directly working via Forklift on my webserver. If I click in SublimeText the first time "save", the file gets uploaded and everything is fine.
After that I can hit save as much as I want, nothing happens.

The same behavior happens with LightPaper.

In all my test cases I changed value RewriteBase in the .htaccess

@rhukster
Copy link
Member

ok, i have a feeling my fix is not working as I have two other reports that it didn't work.. grr.. i'll try again, but its so hard when i can't reproduce it myself!

Anyway, for the cache to get updated, you have to change a file in the user/pages/ folder (changing anything out of this folder will not effect the page cache). Also you probably will have to actually make an edit, not just hitting save. So keep that in mind.

For most people, editing a file automatically updates the parent directory with the same modified date. It seems for some people this doesn't happen. This is particularly strange because one user who has this issue is running OS X 10.9 with the same filesystem, php version, and even the same web server configuration as me.

The previous method only checked folders, as this is the fastest way to check the modified dates. This new method I added actually checks every file individually. This really should work :) But it seems its not. So I will dig into it more tomorrow. Thanks for helping track down this issue guys!

@schurb
Copy link

schurb commented Aug 29, 2014

You're right, the folder modify-date is older than the file modify date.
But as I use the development branch, it should work :)

I insert some wild keystrokes and than hit save. So there should be some actual changes...

@rhukster
Copy link
Member

Ugg.. i just tried 2 other macs, a macbook air, and a mac mini. Both work fine even though one was running Yosemite beta with mamp pro, the other is mavericks with built-in apache and homebrew php. I just wish I could find a setup that failed like you guys are seeing.

@schurb
Copy link

schurb commented Aug 29, 2014

I am running everything at Domainfactory on a simple shared webserver.

@sthag
Copy link

sthag commented Aug 29, 2014

I also tried the github version. Just to make sure I did it correctly.
I used the 0.9.0 zip from the page and copied over all files from github.

But changes to *.md are not visible within the browser.

The date that changes is always the modified date value. The creation date stays the same. At least at this point its behaviour is normal. I read about many problems windows people have with folder dates.

@rhukster
Copy link
Member

Ok, i think i have this resolved now. Please try the develop branch guys.

@schurb
Copy link

schurb commented Aug 30, 2014

Works for me 👍

Great work @rhukster and the whole team :)

@rhukster
Copy link
Member

Awesome, we'll get a 0.9.1 release out early next week with this and a couple of other bug fixes.

@sthag
Copy link

sthag commented Aug 30, 2014

Yes, I can confirm it also works for me.
Woohoo. Thanks.

@rhukster
Copy link
Member

Thanks for helping us get to the bottom of this.

@mahagr
Copy link
Member

mahagr commented Aug 20, 2015

Commit was supposed to be for getgrav/grav-plugin-admin#38

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

6 participants