Pico-Editor-Plugin icon indicating copy to clipboard operation
Pico-Editor-Plugin copied to clipboard

Fix subdirectories

Open exhnozoaa opened this issue 12 years ago • 12 comments

In this fork/branch, do_open(), do_save(), and do_delete() now support subdirectories and index.md files. Instead of using basename() on the URL, it is now using parse_url().

Currently, Pico does not support files with the same names as directories. In this fork/branch, the plugin uses the correct file/directory based on a trailing slash being used for directories and no trailing slash being used for files. However, this will not fix that the directory will override the file on the Pico front end (a different bug for a different project).

exhnozoaa avatar Jul 19 '13 05:07 exhnozoaa

This is meant to address issue #2, but I can't seem to figure out how to link them in GitHub. I apologize for the duplicate issue.

exhnozoaa avatar Jul 19 '13 05:07 exhnozoaa

This didn't fix my issues. If anything now I can't edit anything.

csholmq avatar Aug 13 '13 11:08 csholmq

Thanks for the feedback. Hmm... I'm not sure what the problem could be. Where there any error messages, or did it just not work?

exhnozoaa avatar Aug 13 '13 23:08 exhnozoaa

I have no idea. I turned on all PHP errors but nothing showed up. All I get is Error: Invalid file. I can successfully create and edit a file. But as soon as I click on another file the error message pops up. So something is up with opening them.

csholmq avatar Aug 14 '13 12:08 csholmq

I did some probing and it's line 122 that goes off. I.e the second die(error) in do_open. I think it's due to my site being in a subdirectory.

print_r($parse_file_url) Array ( [scheme] => http [host] => honken.eu [path] => /pages/blog/pwd_req )

echo CONTENT_DIR . $parse_file_url['path'] /share/MD0_DATA/Web/pages/content//pages/blog/pwd_req

As you can see /pages is my subdirectory and is in both path and the physical file path.

csholmq avatar Aug 14 '13 14:08 csholmq

It will be nice, to be able to create subdirictory and a new page in subdirictory; btw, - thanks

pomaxa avatar Aug 27 '13 14:08 pomaxa

@exhnozoaa I've taken your changes and create a new pull request with some more improvements (https://github.com/gilbitron/Pico-Editor-Plugin/pull/5)

pomaxa avatar Aug 28 '13 09:08 pomaxa

@varakh - I haven't use pico for a while, - so can't tell you right now, but if you can describe the error in my version, I'll be able to update it.

pomaxa avatar Mar 12 '14 11:03 pomaxa

@varakh have you update base_url ?

pomaxa avatar Mar 12 '14 12:03 pomaxa

all scripts use this var when load resources like

<script src="{{ base_url }}/{{ plugin_path }}/epiceditor/js/epiceditor.min.js"></script>

so if you change your base_url, by moving your project from root dir, please be sure to update this var.

pomaxa avatar Mar 12 '14 12:03 pomaxa

@varakh - have you check error log ? can you show an example?

pomaxa avatar Mar 12 '14 16:03 pomaxa

@pomaxa I just moved it to / and won't try it in /blog/ again. Guess I won't be able to figure out a solution to this problem. But nevermind. It's okay like this. Thanks anyway.

ghost avatar Mar 12 '14 17:03 ghost