Title: Gallery path created incorrectly
Last modified: April 7, 2020

---

# Gallery path created incorrectly

 *  Resolved [ade11](https://wordpress.org/support/users/ade11/)
 * (@ade11)
 * [6 years ago](https://wordpress.org/support/topic/gallery-path-created-incorrectly/)
 * We note paths are being created incorrectly again for Galleries, so creating 
   new galleries and uploading to them fails on our system.
 * We run a large multisite that has been going for many years, so still uses the
   blogs.dir/blog_id/file method for site upload directories.
 * We note this guess in line 49 of _products/photocrati\_nextgen/modules/nextgen\
   _settings/module.nextgen\_settings.php_;
 * `'gallerypath'=>implode(DIRECTORY_SEPARATOR, array('wp-content', 'uploads', '
   sites', '%BLOG_ID%', 'nggallery')).DIRECTORY_SEPARATOR`
 * Please could you use wp_upload_dir() as you do in other places?
    [https://developer.wordpress.org/reference/functions/wp_upload_dir/](https://developer.wordpress.org/reference/functions/wp_upload_dir/)
 * Thanks !

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Mihai Ceban](https://wordpress.org/support/users/mihaiimagely/)
 * (@mihaiimagely)
 * [6 years ago](https://wordpress.org/support/topic/gallery-path-created-incorrectly/#post-12649888)
 * Hi [@ade11](https://wordpress.org/support/users/ade11/),
 * I am assuming that we have a different path related issue ( perhaps a side effect
   of the previous path related issue that we have fixed for WordPress.com ) and
   I must agree that this issue is a bit challenging.
 * Just FYI, I have informed the entire team about it and worth noting that it is
   surely a highly prioritized one for us.
 * We will keep you informed in case of any news, in the meantime, you can temporarily
   rollback to NextGen Gallery 3.3.0 that can be downloaded from here: [https://wordpress.org/plugins/nextgen-gallery/advanced/](https://wordpress.org/plugins/nextgen-gallery/advanced/)
   until a new update with the fix will be released.
 * We are sorry for the inconveniences
 *  [Mihai Ceban](https://wordpress.org/support/users/mihaiimagely/)
 * (@mihaiimagely)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/gallery-path-created-incorrectly/#post-12655643)
 * I just want to let you know that we have fixed and released an update for NextGen
   Gallery that should officially fix the previously path related issue.
 * Can you please update to NextGen Gallery 3.3.5 and confirm that everything works
   fine?
 *  Thread Starter [ade11](https://wordpress.org/support/users/ade11/)
 * (@ade11)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/gallery-path-created-incorrectly/#post-12679163)
 * Imagely,
 * Thanks for attending to this so quickly, we are most appreciative!
 * Sadly, the line #49 of the mentioned `module.nextgen_settings.php` is unchanged
   and still contains that incorrect method. That function there appears to set 
   the path going forward for all gallery creating so is fundamental.
 * If we change your line to for instance; `'gallerypath' => @wp_upload_dir()['path']`,
   just as an example, then it creates galleries in the correct location.
 * For legacy + security issues on our multisite, wp-content/uploads doesn’t exist
   and can’t be created by plugins (not owned by apache).
 * We have seen other servers also where the whole wp-content directory is moved,
   it is allowed, so your method effectively hard-codes an error.
 * On the other hand, if you use the WordPress-provided `wp_upload_dir()` function
   then that will always return the correct value regardless of environmental and
   server settings and the benefit will be your plugin can work in all situations.
   Please could you consider using the WordPress method instead?
 * Many thanks!
    -  This reply was modified 5 years, 11 months ago by [ade11](https://wordpress.org/support/users/ade11/).
 *  [gabyimagely](https://wordpress.org/support/users/gabyimagely/)
 * (@gabyimagely)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/gallery-path-created-incorrectly/#post-12799339)
 * Apologies [@ade11](https://wordpress.org/support/users/ade11/),
 * You are right! thank you so much for letting us know.
    The developers are following
   your suggestion. We appreciate contributions from the community.
 * Many thanks!
 *  Thread Starter [ade11](https://wordpress.org/support/users/ade11/)
 * (@ade11)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/gallery-path-created-incorrectly/#post-13059582)
 * Imagely,
 * We note you have added a new filter ‘ngg_default_global_settings’ in your latest
   release so that theme developers may change the path, but the method used to 
   initially set the path is still the same `implode(DIRECTORY_SEPARATOR ...` method.
 * Surely you should _default_ to the correct `wp_upload_dir` method, which would
   be correct then in all cases, but in case it really wasn’t they can use your 
   new filter?
 * Whilst we like the idea of filters, many of our sites are built by people without
   programming skills, which is the strength of WordPress, so though we appreciate
   you have _addressed_ the problem, we still do not believe you have _fixed_ it.
 * It is a very tiny change to make your plugin fully WordPress compliant, please
   can you ask your developers to reconsider implementing `wp_upload_dir` in all
   places where the path is needed ?
 * To note, your plugin uses this implode method in 2 places, but uses wp_upload_dir
   in 4, so it seems inconsistent?
 * We look forward to your next release !
 * Many thanks.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Gallery path created incorrectly’ is closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

## Tags

 * [blogs.dir](https://wordpress.org/support/topic-tag/blogs-dir/)
 * [gallery](https://wordpress.org/support/topic-tag/gallery/)
 * [paths](https://wordpress.org/support/topic-tag/paths/)

 * 5 replies
 * 3 participants
 * Last reply from: [ade11](https://wordpress.org/support/users/ade11/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/gallery-path-created-incorrectly/#post-13059582)
 * Status: resolved