Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Flexform › URLs are not being generated correctly
New Landing › How can we help? › Themeforest Theme Support › Flexform › URLs are not being generated correctly
- This topic has 8 replies, 2 voices, and was last updated 9 years by Mohammad – SUPPORT.
-
Posted in: Flexform
-
June 17, 2015 at 4:08 am #185242
I moved to a new server and all was working great. I have been on it for a few months now. I dont know when this happen but now some of the url contain my shared path..
Should be:
<img src="https://www.xxxxxxxx.com/xxxxx/wp-content/themes/flexform/includes/options/img/logo-left.png" alt="Left Logo" />
but is:
<img src="https://www.xxxxxxxx.com/var/www/shared/xxxxx/wp-content/themes/flexform/includes/options/img/logo-left.png" alt="Left Logo" />
It is not on all links, some come out correctly. How do I fix this,
Here is what I tried. Reloading FLexform again from a fresh download off of Themeforest, look into database on for hard coded links, reinitiated my symlink.
Is the code not recognizing the symlink properly?
June 17, 2015 at 5:34 am #185248Hi,
We dont have this issue with our installation. Please deactivate all plugins and check for this issue.
Thanks
MohammadJune 17, 2015 at 6:00 am #185262Hello Mohammad,
I am not saying that you have this issue. I have had this theme installed for a long time and I have not added any plugins. Everything has been working together for a long time, about 1yr to be exact.
It just started to happen when I switched servers. I have the wp-contents in a shared directory because I am on a scaling server now. So the wp-contents is a symlink to the shared wp-content folder which is at /var/www/shared/wp-content.
No other plugin or wordpress are being affected by this except Flexform. Only Flexform urls contain the full server path in them.
Where in the theme are you requesting the url path?
June 17, 2015 at 6:07 am #185264also just tried deactivating all plugins, Didnt work.
June 17, 2015 at 8:24 am #185303Hi,
Can you please contact at hosting provider about this issue?
Thanks
MohammadJune 17, 2015 at 9:39 am #185332Hello Mohammad,
Its your scripts fault. I fixed it and I would consider it a bug. In the defaults.php file you are assuming that $fslashed_dir and $fslashed_abs are going to have the same base you can use them to define Redux_OPTIONS_URL to strip away the base of the server path to leave the theme path.
flexform > includes > options > defaults.php (lines 5 & 6)
$fslashed_dir = trailingslashit(str_replace('\\','/', dirname(__FILE__))); echo debug_to_console($fslashed_dir); //$fslashed_abs = trailingslashit(str_replace('\\','/', ABSPATH)); $fslashed_abs = trailingslashit(str_replace('\\','/', '/var/www/shared/biafeb/')); echo debug_to_console($fslashed_abs); echo debug_to_console(ABSPATH);
Which works almost every time unless you are in a situation like mine where I am using scaling servers so I put my wp-content in a static server and use a symlink to get to it. This causes the dirname(__FILE__) of the template to be different from the original dirnmae(__FILE__) set when wordpress initiated. If you notice the echos above, those are my debugging steps to figure out what was going on. Below are the results from those.
echo debug_to_console($fslashed_dir); --> PHP: /var/www/shared/xxxxx/wp-content/themes/flexform/includes/options/ echo debug_to_console($fslashed_abs); --> PHP: /var/www/shared/xxxxx/ echo debug_to_console(ABSPATH); --> PHP: /home/www-upload/xxxxx/
Check out my screenshots. I hope this helps.
Attachments:
You must be logged in to view attached files.June 17, 2015 at 10:06 am #185350Hi,
Brilliant! I am glad that you managed to resolve the issue.
Thanks
Mohammad
June 17, 2015 at 10:12 am #185351Hello Muhammad,
No problem. I hope that you have a solution for future releases for users who will be in a similar situation.
Respectfully,
Batteryman
June 17, 2015 at 10:16 am #185352Hi,
Sure, We will have in future.
Thanks
Mohammad
-
Posted in: Flexform
You must be logged in and have valid license to reply to this topic.