WordPress.org

Ready to get started?Download WordPress

Forums

Lazyest Gallery
[resolved] gallery folder on localhost (19 posts)

  1. Joy
    Member
    Posted 1 year ago #

    I'm using version 1.1.16 and I have a problem on my localhost test site when entering the gallery folder. Actually, I don't enter it but it is saved as displayed, so I have to re-enter it.

    I'm using XAMPP on Windows, so my paths have backslashes. I can enter the gallery folder as ../photos/ and it is found. But when I select my settings and save, it uses the displayed path of ..\photos and saves that, which means it is no good. It needs to not convert to backslashes and display what I entered previously.

    http://wordpress.org/extend/plugins/lazyest-gallery/

  2. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

    It converts to backslashes because you are on a Windows system. The folder is used by php on your server. Your web log will display forward slashes.

  3. Joy
    Member
    Posted 1 year ago #

    I understand why, but I don't agree that it should. When you output the gallery folder path on the settings page, it should be what I entered previously, not the converted path. Because when I hit Save, that bad path with backslashes replaces the good path with forward slashes that I entered before.

  4. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

    In Windows, the 'good' path has backslashes.

  5. Joy
    Member
    Posted 1 year ago #

    When you are in Windows, that's is true, but when in WordPress, that is not true.
    The plugin checks the gallery folder input field to see if the path is correct. If I enter backslashes in that text field, it is interpreted as escaped characters, so the path is invalid.
    It shouldn't be that difficult to save what is entered without any conversion.
    You should try it, so you can see what I'm talking about.

  6. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

    I don't see the escaped character issue running on WAMPSERVER.
    I'm using a path like ..\wp-content\uploads\lg-gallery\

  7. Joy
    Member
    Posted 1 year ago #

    That path would work if it had forward slashes. Did you hit Save after it found the path? When you enter that path in exactly like that, it doesn't find it because of the backslashes creating special characters in the input.
    My folder is ../photos/ and it does not find it when it changes it to ..\photos

  8. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

    weird, I did hit save. something's different on XAMPP vs WAMP I guess.
    Any chance I could look on your server?
    Please leave a topic on http://brimosoft.nl/forums/forum/how-to-and-troubleshooting/ so I could send you an email

  9. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

    Sorry, my bbpress plugin made a hickup. Your post did not get your e-mail or name.

    Lazyest Gallery replaces slashes to be compatible with your server OS.
    So on Windows, forward slashes get replaced by backslashes
    This was necessary because of crashes on Windows servers.
    I can't reproduce your error on my machines. Even with obvious 'escaped characters' like \n in ..\..\wp-content\new-gallery\ the folder can be found.

  10. Joy
    Member
    Posted 1 year ago #

    I understand why you would change to backslashes, and that it might even be automatic in some function you call, but you don't need to switch and you definitely don't need to show the user something different than what was entered. The big problem comes when the converted path is saved because then it is invalid. It's not when entered, it's when it is saved again. In order to keep the settings working, the user has to go back to the path field and fix it, even though they only wanted to change some of the other settings (not the path).
    It sounds like you didn't test the scenario all the way through:
    0. plugin prompts for gallery folder path only
    1. user sets the gallery folder path and saves
    1a. plugin finds it and shows the settings fields (including a modified path)
    2. user changes sizes etc. and saves (path is saved with backslashes)
    2a. plugin still finds path and shows settings
    3. user changes another setting and saves (without changing path)
    3a. plugin now can't find path and doesn't show settings

    The critical point is to redisplay what the user typed originally, not the modified version.

  11. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

    I don't see a reason to save the user input also. I'd rather fix this bug.

  12. Joy
    Member
    Posted 1 year ago #

    Plugins that convert to backslashes and redisplay always have the problem of the increasing backslashes, because to enter one you have to type two, so each time it is converted and redisplayed it grows.

  13. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

    hm, wish I could repeat that, backslashes save and resave normal in Lazyest Gallery settings. I'm still searching why it wouldn't work on your XAMPP server.

  14. kchayka
    Member
    Posted 1 year ago #

    FWIW, I'm on a WAMP localhost server and never use backslashes in path names for any PHP app. Neither Apache nor PHP ever seem to have an issue locating files with forward slashes in a path name on my Windows box. It is possible IIS might have issues with forward slashes, though it follows that many open source products would fail to run on IIS if that were true, including WP. WP only uses forward slashes in paths, such as all its include statements.

    I think it should be pretty safe to abandon the back slashes.

  15. lazyest_developer
    Member
    Posted 1 year ago #

    true,
    lazyest-gallery 2.0 will abandon backslashes

  16. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

  17. Joy
    Member
    Posted 1 year ago #

    I just tried it on my localhost, and that works much better! Thank you. I didn't try it on a live server.

    I see one problem though. The default path makes sense, but you need some sort of dirty bit, so you know whether the user has set the path or not. Despite my having had the plugin installed and running before, when I activated this new version, it had wp-content/uploads/ as the path instead of my photos path.
    I activated and went straight to the gallery setup page, not the settings page (because that's what's visible in the menu and I forgot how to use this plugin), so the plugin started churning out xml files for all my subfolders. Since you do write to the disk, you should be careful that you have the right settings before you write. If there were a check for whether the user had set the path (dirty bit) before generating the xml files, it would be much more friendly.

  18. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

    Okay, thanks for the warning. The plugin should do that. I'll check.

  19. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

    Have just checked.
    If the path is empty, the Lazyest Gallery menu will not appear and the writing of xml files is deactivated. The settings menu will show a warning. Also, if you set the path to one of the core WordPress subdirectories, the plugin will deactivate all but he Settings page.
    However, the wp-content/uploads/ directory is considered 'save' to be used as a gallery directory. Maybe because of your earlier attempts to get the path fixed, wp-content/uploads/ remained in your settings.
    I'll add a rule so wp-content/uploads/ or other default WordPress upload folders cannot be selected for Lazyest Gallery.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.