Before you ask please READ THIS

Unable to set fonts in theme customize drop down

Hi,

I have successfully started and imported the Verona demo in a roots/Bedrock base installation.

However in the theme customise fonts settings none of the google fonts drop downs are populated.

I have WP_DEBUG and WP_DEBUG_LOG enabled (as suggested) and am seeing the following error when I go to Appearance -> Customise:-

[29-Aug-2016 21:53:50 UTC] PHP Notice:  Undefined index: action in /srv/www/verona.dev/current/web/app/themes/fatmoon/advance/inc/Apollo13_Image_Resize.php on line 250
[29-Aug-2016 21:53:50 UTC] PHP Stack trace:
[29-Aug-2016 21:53:50 UTC] PHP   1. {main}() /srv/www/verona.dev/current/web/wp/wp-admin/admin-ajax.php:0
[29-Aug-2016 21:53:50 UTC] PHP   2. require_once() /srv/www/verona.dev/current/web/wp/wp-admin/admin-ajax.php:22
[29-Aug-2016 21:53:50 UTC] PHP   3. require_once() /srv/www/verona.dev/current/web/wp/wp-load.php:44
[29-Aug-2016 21:53:50 UTC] PHP   4. require_once() /srv/www/verona.dev/current/web/wp-config.php:9
[29-Aug-2016 21:53:50 UTC] PHP   5. include() /srv/www/verona.dev/current/web/wp/wp-settings.php:387
[29-Aug-2016 21:53:50 UTC] PHP   6. Fatmoon_Apollo13->start() /srv/www/verona.dev/current/web/app/themes/fatmoon/functions.php:11
[29-Aug-2016 21:53:50 UTC] PHP   7. require_once() /srv/www/verona.dev/current/web/app/themes/fatmoon/advance/fatmoonApollo13.php:167
This is happening when the site renders and before opening the General Settings -> Font Settings side bar.

Also of note is that the roots/Bedrock installation I am using is relocating the web app (including the theme) to the web/app folder rather than the standard wp-content folder. Also wordpress is installed in the wp sub-folder. Also the settings are not in the usual wp-config.php. Not sure if that has any bearing here? https://roots.io/bedrock/docs/composer/

Note: Some plugins may create files or folders outside of their given scope, or even make modifications to wp-config.php and other files in the app directory. These files should be added to your .gitignore file as they are managed by the plugins themselves, which are managed via Composer. Any modifications to wp-config.php that are needed should be moved into config/application.php.

Does the Fatmoon theme, or any of the Verona plugins from the demo import create files or folders outside of their given scope, or make modifications to wp-config.php and other files in the app directory?

Thanks
Screenshot from 2016-08-29 23-06-46.png
1072 x 955 - 559K

Comments

  • AirAir
    Posts: 10,970
    paul_robinson_ said: Does the Fatmoon theme, or any of the Verona plugins from the demo import create files or folders outside of their given scope, or make modifications to wp-config.php and other files in the app directory?
    All creating is done inside theme folder. Only images are created in wp-content/uploads/apollo13_images

    It looks like your notice is connected to images. However I don't know what connection it would have with fonts. It may just be side effect.

    With kind regards.
  • Thanks. I suspect I'll need to get a staging server actually set up so you can see what's going on.
    Alternatively I could let you know the trellis/bedrock configuration I'm using to see if you can reproduce locally.
    Which is best for you?

    Thanks,
    Paul
  • AirAir
    Posts: 10,970
    Well it works normal on "standard" servers, and I don't have knowledge about systems that you are trying to use.
    Sure I can help you debug it, but it looks like some constants are setup different in your environment.

    Give me info when you will have it online.

    With kind regards.
  • Ok will do. I started that work last night so hoping to have it up soon. Cheers
  • I have finally managed to get a staging server up. I'll pm you the details.

    When I was looking last night, it looks like there's an error trying to load the redux-framework css file.

    GET http://staging.aislingandpaul.rocks/wp/wp-admin/customize.php?return=%2Fwp%2Fwp-admin%2Fusers.php http://staging.aislingandpaul.rocks/wp/srv/www/aislingandpaul.rocks/releases/20160911200745/web/app/plugins/redux-framework/ReduxCore/inc/extensions/customizer/extension_customizer.css?ver=1473684612

    Looks like it's attempting to get it from the wrong base url.
    Bedrock installs has all the wordpress stuff under the wp directory, while nginx is serving all the content from /srv/www/aislingandpaul.rocks
  • hi guys. Is anyone available to look at this for me?
    Thanks
  • AirAir
    Posts: 10,970
    Reply on PM - can't login to your site yet.
  • AirAir
    Posts: 10,970
    OK I have logged in but I can't tell anything just from your site. Like you said problem is in wrong paths.

    This CSS file path you pointed out is generated in wp-content\plugins\redux-framework\ReduxCore\inc\extensions\customizer\extension_customizer.php line ~85
    $this->_extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->_extension_dir ) );
    It looks that these redirects on your server breaks something, but I don't know what.
    It may also be, that this part of Redux is poorly written, as for this CSS code depends on _dir location which can lead to such error.
                    if ( empty( $this->_extension_dir ) ) {
                        $this->_extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) );
                        $this->_extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->_extension_dir ) );
                    }
    And in other files it uses path defined in ReduxFramework::$_url.

    However I might be wrong here.

    With kind regards.
  • Ok thanks. I noticed that redux is included in the theme zip. As I remember I used composer to grab redux. Are you providing a customised redux?

    Also the environment variables are all defined here: https://github.com/roots/bedrock/blob/master/config/application.php
    I figured the code should be making use of WP_SITEURL or WP_CONTENT_URL

    Thanks
  • AirAir
    Posts: 10,970
    Yes, it was customized Redux, however from next version it will be normal version as we moved our changes away from plugin.

    Have you tried setting up your site without this redirects to different(then default) directories?

    With kind regards.
  • edited September 2016 Posts: 18
    I assume you're referring to the bedrock directory structure? If so then it's really a core part of the framework, with a separation of concerns from the wordpress installation and the content. This seems like a good thing to me.
    https://roots.io/bedrock/docs/folder-structure/
    I've tested on a docker container with the default directory structure and it works. Do you think you could have a chat to the redux developers to see if there are known issues with deployment in a bedrock install?

    Also when will the next version with the non-customised redux be out?

    Thanks
    Post edited by paul_robinson_ on
  • AirAir
    Posts: 10,970
    paul_robinson_ said: Also when will the next version with the non-customised redux be out?
    Sorry for misleading you here, you already have version without modification, see changleog -> http://www.apollo13.eu/themes_update/fatmoon/index.html
    paul_robinson_ said: I've tested on a docker container with the default directory structure and it works. Do you think you could have a chat to the redux developers to see if there are known issues with deployment in a bedrock install?
    I think you could do it on their github, as you know you case better https://github.com/reduxframework/redux-framework/issues/

    Only thing I can do is to try to debug on your staging server what exactly is wrong with those paths, but I would need FTP access to it if possible.

    With kind regards.
  • Sure. I'll pm you again. Thanks again
  • AirAir
    Posts: 10,970
    Thanks for access.
    I have mad such change in plugins\redux-framework\ReduxCore\inc\extensions\customizer\extension_customizer.php line ~85 and it started to work:
                    if ( empty( $this->_extension_dir ) ) {
    		$this->_extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) );
                    $this->_extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->_extension_dir ) );
                    }
    
    to
                    if ( empty( $this->_extension_dir ) ) {
    		// $this->_extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) );
                    // $this->_extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->_extension_dir ) );
                    $this->_extension_url = ReduxFramework::$_url.'inc/extensions/customizer/';
                    }
    
    We will get back to this.

    With kind regards.
  • That works very well. I haven't noticed any javascript errors since. I'll check around as I customise the theme.

    Much appreciated!
  • edited September 2016 Posts: 18
    Hi guys,

    I've upgraded to the latest version and am now seeing something very similar in the extension_advanced_customizer.php contained in the fatmoon theme.

    It's giving a 404 for http://staging.aislingandpaul.rocks/wp/srv/www/aislingandpaul.rocks/releases/20160928221011/web/app/themes/fatmoon/advance/advanced_customizer/extension_advanced_customizer.js?ver=1.1.04

    I tried to do the same as above, but the urls that it needs are actually the fatmoon theme base url, not the Redux Framework plugin base url.

    The javascript it's trying to load is in the theme.
    find . -name 'extension_advanced_customizer*' ./web/app/themes/fatmoon/advance/advanced_customizer/extension_advanced_customizer.js ./web/app/themes/fatmoon/advance/advanced_customizer/extension_advanced_customizer.php

    So far I've got:-
    Lines 85-89 in extension_advanced_customizer.php
    if ( empty( $this->_extension_dir ) ) { //$this->_extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) ); //$this->_extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->_extension_dir ) ); $this->_extension_url = ReduxFramework::$_url.'advance/advanced_customizer/'; }

    Which is referenced at line 170
    function enqueue_controls_css() { ... wp_enqueue_script( 'redux-extension-advanced-customizer', $this->_extension_url . 'extension_advanced_customizer.js', array( 'jquery', 'redux-js' ), ReduxFramework_extension_advanced_customizer::$version . '4', true ); }

    Is there a variable I can use for the theme base url?

    Also did you manage to speak to the Redux Framework guys?

    Thanks,
    Paul
    Post edited by paul_robinson_ on
  • AirAir
    edited September 2016 Posts: 10,970
    Hello:-)
    paul_robinson_ said: Also did you manage to speak to the Redux Framework guys?
    No I didn't, sorry. I will try to formulate your issue to them after I finish this reply to you.
    paul_robinson_ said: I've upgraded to the latest version and am now seeing something very similar in the extension_advanced_customizer.php contained in the fatmoon theme.
    Strange that you see this now, as this change was in theme from 3 versions already.

    However this time we have copied their buggy code, so lets try to fix it:-)

    Go to line ~87 in fatmoon\advance\advanced_customizer\extension_advanced_customizer.php
    and change this:
    $this->_extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->_extension_dir ) );
    to
    $this->_extension_url = A13FRAMEWORK_TPL_ADV.'/advanced_customizer/';
    Try it and tell me how it is.

    With kind regards.
    Post edited by Air on
  • AirAir
    Posts: 10,970
    I have posted issue here https://github.com/reduxframework/redux-framework/issues/3136

    With kind regards.
  • Awesome. Yep that's fixed it. I suppose I wasn't looking too hard for console errors after the fonts fix reported earlier so I think I associated it with the recent update.
    Thanks for raising the issue with Redux. Btw this isn't deployed in a docker container. I moved away from that after thinking about how the database layer would work. trellis/bedrock is installed on VMs instead. Regardless, I think your observations about their code are valid ;)
    I'll be interested to see how they respond.
    Thanks again.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!