sage-xpress icon indicating copy to clipboard operation
sage-xpress copied to clipboard

Invalid Argument error

Open minimallinux opened this issue 7 years ago • 6 comments

I have an invalid argument error in SageExpress.php?

Warning: Invalid argument supplied for foreach() in /usr/local/ampps/www/wp/wp-content/themes/bootstrap/vendor/webstractions/sage-xpress/src/SageXpress.php on line 69

I haven't changed anything in this file.

minimallinux avatar Nov 18 '17 10:11 minimallinux

Also, error for menu insertion is displaying as plain text. navwalkererrorsageexpress

minimallinux avatar Nov 18 '17 12:11 minimallinux

Did you copy the config files from this package into your theme? Specifically, config\app.php, which has the list of providers that it is looking for.

webstractions avatar Nov 18 '17 15:11 webstractions

Also make sure you are using the latest version. I added the auto-loading of providers in v0.2.0.

webstractions avatar Nov 18 '17 15:11 webstractions

@minimallinux Are you still having trouble with this?

webstractions avatar Dec 04 '17 19:12 webstractions

I'm getting this message too. I have copied the config files to my theme /config folder but it seems like the providers can't be found. I'm using Sage 9.0.0-beta.4 with the soberwp/controller - beta 4 too

sagexpress

bodenko avatar Feb 07 '18 16:02 bodenko

I found I have to also call them in to functions.php:

Container::getInstance()
    ->bindIf('config', function () {
        return new Config([
            'assets' => require dirname(__DIR__).'/config/assets.php',
            'theme' => require dirname(__DIR__).'/config/theme.php',
            'view' => require dirname(__DIR__).'/config/view.php',

            /* new files from SageXpress - add the following lines: */
            'app' => require dirname(__DIR__).'/config/app.php',
            'blade-directives' => require dirname(__DIR__).'/config/blade-directives.php',
            'menu' => require dirname(__DIR__).'/config/menu.php',
            'sidebar' => require dirname(__DIR__).'/config/sidebar.php',
            'comments' => require dirname(__DIR__).'/config/comments.php',
            /* END */

        ]);
    }, true);

You can comment out what you don't need but I think app.php has to be there.

robrecord avatar May 18 '18 14:05 robrecord