Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.1.7, image, load balancer, ssl
- This topic has 7 replies, 2 voices, and was last updated 7 years, 6 months ago by
Steven Zahm.
-
AuthorPosts
-
02/09/2015 at 1:03 pm #318800
kkthompson
GuestHi,
We just upgraded the Connections plugin to the latest version, 8.1.7. Now the images do not display and we have this error appearing in the manage module, ERROR: The $img_path variable has not been set.
Can you provide a clue as to how to fix please? This is on our Intranet so I cannot provide an account.
Also, we do not have the image path set in the wp-config.php file.
The images are in this folder, wp-content/uploads/connections-images. In the past we have had issues with http and https protocol not being detected by WP because of our headers, just fyi.
Thanks in advance.
02/09/2015 at 3:15 pm #318817Steven Zahm
Keymaster@ kkthompson
When that error happens that means it is an edge case type of issue. Not having access will make this bit more difficult to troubleshoot.
The first thing, I’ll need a screenshot of the System widget on the Connections : Dashboard admin page.
Open the Connections : Manage admin page that has the error. Hit Ctrl+U to view that page source. Save the page source as a txt file. I’ll need a copy of that file.
Lastly, on line 1509 of this file:
../wp-content/plugins/connections/includes/image/class.image.php
Add this:
var_dump( $img_path );var_dump( file_exists( $img_path ) );
This will cause quite a bit of error code text to show on the page. I’ll need a copy of error code text it displays. After you’ve copied the text, you can remove the code.
Oh…
When you add/update plugins, does WordPress prompt you for the FTP use/pass?
Can you upload images to the WordPress Media Library without an errors?
02/09/2015 at 4:53 pm #318843kkthompson
GuestThis reply has been marked as private.02/09/2015 at 6:31 pm #318846Steven Zahm
Keymaster@ kkthompson
That
NULL
is the problem. This means the requested image source URL is not within the theme directory or within the uploads directory.I still need the screenshot of the System widget on the Connections : Dashboard admin page.
On line 1509, add this and let me know the results:
var_dump( $source );var_dump( $upload_info );var_dump( $theme_dir );
Once again it’ll output a lot, but I only need to see the results of one series.
02/10/2015 at 9:58 am #318896kkthompson
GuestOkay, thanks, the screenshot can be pulled from here: http://rigamajig.org/image-post temporarily.
Let me know if you need anything else. BTW, I noticed that the CN variables with URL protocol all should read ‘https‘. This could be causing the failure.
We use this plugin to notify WP of our protocol, because the header does not contain the info, https://gist.github.com/webaware/4688802.
Output of var_dumps added at 1509 in class.image.php:
string(104) “http://server.gov/wp-content/uploads/connections-images/dina-abrams/dabrams_original.jpg” array(6) { [“base_path”]=> string(42) “/var/www/server/html/wp-content/uploads/” [“base_url”]=> string(50) “https://server.gov/wp-content/uploads/” [“base_rel_url”]=> string(20) “/wp-content/uploads/” [“img_base_path”]=> string(61) “/var/www/server/html/wp-content/uploads/connections-images/” [“img_base_url”]=> string(69) “https://server.gov/wp-content/uploads/connections-images/” [“img_base_rel_url”]=> string(39) “/wp-content/uploads/connections-images/” } string(50) “/var/www/server/html/wp-content/themes/twentyten”
02/10/2015 at 11:32 am #318897Steven Zahm
Keymaster@ kkthompson
Yep, I see the issue.
The
CN_IMAGE_BASE_URL
has thehttp
protocol rather than thehttps
protocol like it should.Inspecting the var dump of the
$upload_info
shows that protocol ishttps
like it should:array(6) { [“base_path”]=> string(42) “/var/www/server/html/wp-content/uploads/” [“base_url”]=> string(50) “https://server.gov/wp-content/uploads/” [“base_rel_url”]=> string(20) “/wp-content/uploads/” [“img_base_path”]=> string(61) “/var/www/server/html/wp-content/uploads/connections-images/” [“img_base_url”]=> string(69) “https://server.gov/wp-content/uploads/connections-images/” [“img_base_rel_url”]=> string(39) “/wp-content/uploads/connections-images/” }
This definitely had me scratching my head since they both use the exact same code to define the URL. Then it occurred to me after looking at plugin you’re using to set https on your site … that plugin must be running after Connections is initiated so
CN_IMAGE_BASE_URL
is set wrong but when the images source URL/s are created the Force SSL plugin has already initiated so the source URL/s are created correctly. Because of the protocol discrepancy, it fails a validation sanity check resulting in the error message you’re seeing.If I’m right, there are two options to resolve this. My recommended fix is…
Since the Force SSL plugin is absolutely required by your site, you should move it to the
mu-plugins
folder. These are initiated before “regular” plugins. This will fix for all plugins and not just the ones that happen to load after it. This folder is in the../wp-content/
folder. If it does not exist, just create it before moving the plugin. You can read more about MU Plugins here:
http://codex.wordpress.org/Must_Use_PluginsThe second fix is to define the
CN_IMAGE_BASE_URL
in thewp-config.php
file. Add this to it:
define( 'CN_IMAGE_BASE_URL', 'path' );
Do not use
path
, instead use the path shown in the System widget forCN_IMAGE_BASE_URL
, but change the protocol fromhttp
tohttps
.The down sides to this fix is image URL/s will always be
https
so if the site is visited inhttp
you’ll have the exact same problem, just in reverse. Also the relative URL for the images will be incorrect but I’m not currently using the relative URL/s so it is safe for now, but in future versions???Let me know how it goes.
02/10/2015 at 4:16 pm #318931kkthompson
GuestWe put the wp-config.php option in place and it corrected our problem with images not displaying. And we won’t have anyone trying to go to http version of our blog, because there is an Apache redirect already in place that makes it impossible. It sends the user to the https version of whatever they typed. I really appreciate the information and the hard work to get this fixed! Thank you, Steven.
02/10/2015 at 4:50 pm #318933Steven Zahm
Keymaster@ kkthompson
Great to hear my solution worked for you!
If you have a moment, I would truly appreciate a review as they really do make a difference. Many thanks in advance!
https://wordpress.org/support/view/plugin-reviews/connections -
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.