I’d like to ask for assiatance with the followig error:
--------```
$ bin/gpm install mediator
[Whoops\Exception\ErrorException]
Invalid argument supplied for foreach()
--------```
At first, when trying to install the theme, I got the error:
--------[RuntimeException] Error while trying to download 'https://github.com/getgrav/grav-theme-mediator/zipball/1.0.3' --------
I got rid off this error by creating directory /home/username/.grav/config, which was mentioned in yet another error below that I fixed with php.ini edit:
--------[Whoops\Exception\ErrorException] file_exists(): open_basedir restriction in effect. --------
Would you please advise how to get through the “Invalid argument supplied for foreach()” error ?
Ok, I just tested and it works fine on my local. So it’s not the mediator theme specifically:
~/workspace/grav 3 $ bin/gpm install mediator
Please select installation method for Mediator (GPM is default)
[0] GPM
[1] Symlink
> 0
Preparing to install Mediator [v1.0.3]
|- Downloading package... 100%
|- Checking destination... ok
|- Installing package... ok
'- Success!
Clearing cache
Cleared: cache/compiled/*
Touched: /Users/rhuk/workspace/grav 3/user/config/system.yaml
By default, GPM expects to use github tarballs to install. The option to install by symlink is for development only. You creating a .grav/config file is what triggers the symlink option, and unless you have that setup 100% correct, will cause that error you are seeing.
The fundamental problem is that you are unable to access those tarballs. So:
Delete your .grav/config file, that is only causing more problems
Nothing jumps out at me there. Assuming you have now removed the .grav/config file, what happens when you do a bin/gpm index ? What about bin/gpm install mediator ?