Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Gilbert Hernandez

    (@ghernkadence)

    Hello @nailedit,

    When you say, “…the plugin now breaks my custom upload folder…” what do you mean? Do you get an error when you try to upload files? Or do files not appear on the front end? Do you see errors, or do files just not upload to your desired location? When you disable the Kadence Blocks plugin, you mentioned that the image and other files work. However, I’m trying to understand how it breaks and how it appears when it works.

    Thread Starter Michael Brütsch

    (@nailedit)

    I mean, that when the Kadence Blocks plugin is active, the whole site acts as “wp-content/uploads” is the default folder, instead of “my-custom-folder” (like ignoring the “define(‘UPLOADS’, ‘my-custom-folder’);” in my wp-config.php file).

    Meaning: New files/images are uploaded to “wp-content/uploads”. And all my existing files and images are not working anymore, because WordPress thinks the path is for example “wp-content/uploads/my-image.jpg”, while the actual file on the server is still in “my-custom-folder/my-image.jpg”.

    So no real error message, just the wrong path.

    By the way: Sorry for the double posting (https://www.ads-software.com/support/topic/plugin-breaks-custom-uploads-folder/), my first post was at first flagged for review and then completely deleted, but now somehow still published.

    Plugin Support Gilbert Hernandez

    (@ghernkadence)

    Hello @nailedit,

    I recreated the scenario you described, and everything appears to work as expected. When you add the define('UPLOADS', 'my-custom-folder'); line to the config file, my files upload to the ‘my-custom-folder’ beside the wp-content folder. However, the images I’ve uploaded previously are not in the ‘my-custom-folder’ so they can’t be accessed by the media library.

    However, all newly uploaded images appear in the ‘my-custom-folder’ and can be accessed by the media library. This behavior is the same whether Kadence Blocks is activated or not.

    To solve the problem, I copied the files from the /wp-content/uploads to the ‘my-custom-folder’ directory and the old images were accessible. Nonetheless, all new uploads correctly uploaded to the ‘my-custom-folder’ directory.

    Thread Starter Michael Brütsch

    (@nailedit)

    Thanks for your reply. After some further investigation (after I couldn’t replicate it on 2 different dev environments) thankfully I found the problem with some simple luck. I had the following line twice in my wp-config.php file (once in the end of the file where it belongs, and once directly before my define('UPLOADS', 'my-custom-folder'); line):

    require_once(ABSPATH . 'wp-settings.php');

    For like over 7 years it never caused a problem, until now with the Kadence Blocks plugin. I don’t care how and why, but yeah, problem solved, thanks for your help! ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Plugin breaks custom uploads folder’ is closed to new replies.