Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assets urls wrong when using redux-framework in Avada theme, in a default wordpress installation in openshift #3054

Closed
lalber opened this issue Jul 19, 2016 · 6 comments

Comments

@lalber
Copy link

lalber commented Jul 19, 2016

Didn't know if this was the correct place for opening this issue, but since the Theme Options assets that breaks are only the ones from redux-framework, I opened it here.

This happens in a default Wordpress installation in openshift, using their official Wordpress cartridge and uploading the Theme. Since I don't know if this is a problem with my installation, a problem with redux-framework or both...

Don't know if there's something to do with the way openshift's wp-config.php is handled:

// absolute path to the WordPress directory
if ( !defined('ABSPATH') )
  define('ABSPATH', dirname(__FILE__) . '/');

// tell WordPress where the plugins directory really is
if ( !defined('WP_PLUGIN_DIR') && is_link(ABSPATH . '/wp-content/plugins') )
  define('WP_PLUGIN_DIR', realpath(ABSPATH . '/wp-content/plugins'));

// sets up WordPress vars and included files
require_once(ABSPATH . 'wp-settings.php');

...fact is this is a correct asset url that it's working from the theme:

https://wordpress-mywebsite.rhcloud.com/wp-content/themes/theme/assets/admin/js/theme-update.js

and an incorrect:

https://wordpress-mywebsite.rhcloud.com/wp-content/var/lib/openshift/578d94660c1e66330d000202/app-root/data/themes/theme/includes/avadaredux/redux-framework/ReduxCore/ inc/fields/button_set/field_button_set.min.js

See how it decided to use the full path of the server, /var/lib/openshift/578d94660c1e66330d000202/app-root/data/themes instead of just themes. Is it a misconfiguration from openshift or really an issue with redux?

@kprovance
Copy link
Member

kprovance commented Jul 19, 2016

You'll have to take it up with the theme developer, since they butchered our code and turned it into their own. It's up to them to support it now. Sorry.

@lalber
Copy link
Author

lalber commented Jul 19, 2016

No problem. I didn't know they created a fork. At least now I know it's their responsibility and if someone search for this issue on google they know where they need to ask for support.

@lalber
Copy link
Author

lalber commented Aug 2, 2016

After getting contact with the support team, they gave us a solution for our specific problem in openshift, since it uses symbolic links. Basically, you need to add this snippet of code (of course, changing https://wordpress-mywebsite.rhcloud.com/ to your url):

function theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style') );
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );

function theme_lang_setup() {
        $lang = get_stylesheet_directory() . '/languages';
        load_child_theme_textdomain( 'Theme', $lang );
}

add_filter( 'redux/_url', 'ReduxSymLinkURL', 10 );
function ReduxSymLinkURL(){
    $url = "https://wordpress-mywebsite.rhcloud.com/wp-content/themes/theme/includes/redux/redux-framework/ReduxCore/";
    return $url;
}

To:

  • A functions.php file, in a new Child Theme;
  • A simple functionality plugin with only functions.php;
  • or just add it to to the functions.php of your in-house plugin if you already have one.

I know this is not related to reduxframework per se, but I'm writing it down here since it may be useful for someone. If you came here after googling for this problem and if this snippet doesn't solve it, you should get in touch with theme support :)

@kprovance
Copy link
Member

I have to add the caveat here for anyone who reads this - since it's become such a problem for us - we do not, repeat not support themes that use our framework. Theme users must always contact the theme developer. If the dev determines there is an issue with our code, they come to us and we get it sorted out. The reason being is because often time theme devs modify our framework, which Avada has done, and it's completely out of our hands. Plus, theme devs got the money, we didn't. ;-)

@lalber
Copy link
Author

lalber commented Aug 2, 2016

@kprovance I think github has a feature of forbidding additional replies in an issue besides closing it, I think it would be a nice idea to do it here.

@reduxframework reduxframework locked and limited conversation to collaborators Aug 2, 2016
@kprovance
Copy link
Member

kprovance commented Aug 2, 2016

Removed all reference to the theme name. I'm not in the way of giving them free advertising, especially since they have not contributed to Redux, or paid for our extensions they are using.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants