• Resolved Angelo Rocha

    (@angelorocha)


    I’m trying to use redux in my theme, but the admin page appears broken. The browser log shows that redux is looking for the js and css files inside my theme’s assets folder, how to fix this?

    See:
    assets-error

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi,

    This looks like a misconfiguration of redux on your theme. based on the console errors, it states that the files that you’re trying to enqueue doesn’t exist on your theme.

    Thread Starter Angelo Rocha

    (@angelorocha)

    How to fix it? I’m using redux including in my composer autoload, my code:

    composer.json:

    "autoload": {
        "files": [
          "inc/lib/ReduxCore/framework.php",
        ]
      },

    My option file:
    https://gist.github.com/angelorocha/5cba306b6ff14c89dd3ce008dee23084

    Thanks

    • This reply was modified 3 years, 3 months ago by Angelo Rocha.

    Hi Angelo.

    I am having the same problem with Redux Framework. I loaded the tool through my functions.php instead of using composer, but I got the same result as you.

    Taking a calm look at the problem, what’s happening is that the Redux base URL is pointing to a parent folder of redux-core folder, so it doesn’t find the assets.

    As I understand it, this error is on line 250 of the class-redux-core file:

    self::$url = trailingslashit(dirname($theme_info['url']));

    The $theme_info['url'] points to the redux-core folder, but by wrapping this variable in dirname, it points to the redux-core parent folder.

    Although it is not recommended to change the assets in the redux-core folder, I changed it as a matter of urgency to proceed with development. I’m going to open an issue in the repository to validate and see if it’s really an error.

    I changed the line to:

    self::$url = trailingslashit($theme_info['url']);

    And everything went back to working normally.

    I hope I’ve helped.

    Plugin Author Kev Provance

    (@kprovance)

    @avallonazevedo , if you submit as issue, PLEASE, include ALL the particulars about your installation. I have a test theme with Redux embedded and changing the line you propose breaks it. If I change it for everyone, I’ll bet the farm this board fills up with complaints about breakage. The question then becomes, what about your installation is different from the standard installation. I know some people modify the structure to move the wp-content folder, and that’s been a huge issue. For that reason we included filters so one may manually set the directory and url. If you are embedding, you conceivably modify the core as you have, but you’d have to do it for each update. That’s why we included the filters. redux/url and redux/dir. I’d try that before modifying the core.

    As far as composer, I’m not certain where the config posted originated. We have our own: https://devs.redux.io/guides/basics/install.html#using-composer (please note all instances of ‘ReduxCore’ are now ‘redux-core.’ I’ve not had time to update the docs to reflect this change.

    Thread Starter Angelo Rocha

    (@angelorocha)

    Thanks for the answers and sorry for the delay.
    I use Redux as a lib to manage my theme options, I currently use it inside my theme and a directory called “lib”, I don’t want to use Redux as a plugin or keep it out of my theme folder, in previous versions to Redux 4 this works fine. Is there any solution to not change the redux core?

    Plugin Author Kev Provance

    (@kprovance)

    The filters, as indicated in my previous reply.

    Thread Starter Angelo Rocha

    (@angelorocha)

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Redux 4.2.14 assets problem, 404 message’ is closed to new replies.