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

"Invalid file " shown when opening file #7

Open
firzen opened this issue Sep 16, 2013 · 6 comments · May be fixed by #10
Open

"Invalid file " shown when opening file #7

firzen opened this issue Sep 16, 2013 · 6 comments · May be fixed by #10

Comments

@firzen
Copy link

firzen commented Sep 16, 2013

content folder structure:
├── 404.md
├── index.html
├── index.md
├── Pico-master.md
└── sub
├── index.md
└── page.md

Then open the /admin url
Pages shown correct in the left
When I clicked on any page on the left . the right area shown "Error: Invalid file"

I position the error on pico_editor.php line 119.
the file url is not corrent .
when I want to edit the index.md, the $file variable = Pico-master
when I want to edit the sub/index.md, the $file variable = sub
when I want to edit the sub/page.md, the $file variable = page

so I suppose this is a very big bug

@shoostar
Copy link

shoostar commented Oct 2, 2013

Although this isn't a fix, here's what I've learned whilst digging around in Pico's files for a few minutes at the office today: You're best off just deleting all of the default pages in your content directory. Optionally, you can leave 404.md in there, as it really doesn't affect the rest of what I'm about to explain.

If you want something else in there to be the home page (rather than just index.md), you can head to lib/pico.php and edit this line:
else $file = CONTENT_DIR .'index';
to something like:
else $file = CONTENT_DIR .'Home';
or whatever you want your home page to be titled. Just make sure that you actually create that page in the Pico editor as well, with the same name/capitalization.

Hope this helps a little bit! By the way, I'm not sure how this affects pages in sub-directories, as I haven't played around with it yet.

@flashpixx
Copy link

I have got the same error, but only on select the "index.md" page, I can fix this with changing the line 115 in pico_editor.php and replace the if(!$file) die('Error: Invalid file'); to if(!$file) $file = 'index';

@flashpixx flashpixx linked a pull request Jan 8, 2014 that will close this issue
@w-vi
Copy link

w-vi commented Jan 9, 2014

I'm afraid that @gilbitron is not really maintaining it as there are no updates in last months and couple of important fixes were submitted. So I suggest doing what I did, taht is fork and merge/fix all the stuff submitted here.

@crempp
Copy link

crempp commented May 15, 2014

@w-vi Thanks,

I would like to suggest people use yours, I reviewed the forks and yours seems to fix most of the issues. I grabbed your code and things are working pretty well now.

@zQueal
Copy link

zQueal commented Aug 12, 2014

@w-vi Just tested your branch, and it works great, man! Thanks.

@dotku
Copy link

dotku commented Feb 25, 2015

Wait for updating...

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

Successfully merging a pull request may close this issue.

7 participants