-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Multisite plugin and theme installs go to the main /user directories #319
Comments
Hey Sean, please add this on the grav-learn repo. This is the admin repo. https://github.com/getgrav/grav-learn |
Hi Andy I was told here (getgrav/grav#472) to add it to the Admin repo. The issue is not with the Instructions in the documentation but that the Admin plugin installs/updates the plugins and themes into the top level rather than into the relevant site's plugin and theme directories in a Multisite setup. |
Well actually its a combination of both documentation and Grav core, but its not really the admin (i think). The main thing is you would need to create a I can't guarantee this works, and if it does not, then that's a bug in the core of Grav in how the streams are setup. However, if it does work, then that needs to be added to the docs :) The admin being the culprit is unlikely but possible. The multisite support really is based on some flexible configuration of PHP streams so Grav will look for things and find things in a certain order (falling back through the stream configuration if it doesn't exist). We obviously can't really test every combination because the flexibility of the approach means there's really no limit to those combinations. We'll just have to address each question as we come to it. |
This is the directory structure I have been trying so far:
I don't know where the issue should be added to though :-( |
Hi @seandowney , I have written the multisite documentation. TL;TR it's neither a grav core nor a grav admin plugin issue. It's how you setup the streams and where you log in. I guess you tried logging in from your "base domain" and not from "one.domain.com" or "two.domain.com" (or even used If you log-in into the respective sites and do the update(s) there, plugins/themes etc. should be installed where you want to. I have multisites running and provided several improvements in order to make it work, otherwise you have found a really special bug. FYI I have a Multisite plugin in development, which will simplify those things. I hope I will release it, when Admin plugin is considered stable and the Pro version comes out. |
Hi @Sommerregen Thank you for the documentation. I am using the setup.php code snippet from the doc for the sub-domain sites but I am using it for two different domains. I am logging into the admin on each domain separately but it still updates/installs the plugins and themes to the top level. I don't have a base domain pointing at the Grav install. The admin does use the plugins from the sites plugins folder but updating puts the update into the top level. I'm new to Grav, could you give me a pointer where I should start with some debugging on the streams? Thanks again |
I did as much debugging as I could and it seems that the GPM class is used to load the package install_path but it doesn't use correct directory for the multisite? |
Will try to recreate this |
I did some more debugging, it seems the package install_path comes in from http://getgrav.org/downloads/plugins.json in Grav\Common\GPM\Remote\Plugins and the constructor in AbstractPackageCollection but it never gets changed to the stream value? |
@Sommerregen do you have the Admin plugin working in a multisite? Can you paste your setup.php file? |
@flaviocopes Yes, I have. Unfortunately, I can't test my multisite environment at the moment, which is broken due to the latest changes made in grav core (refactoring of config class). I'm working on that and will test it as soon as I can. I will leave a note here. |
If that is related to I asked because I have some issues too, running Admin (assets paths are wrong, for example) - the rest seems to work. |
@seandowney what's your setup.php file content? Is it the default you found on the Learn site? |
Hi @flaviocopes yes that's related to |
@flaviocopes yes the same code from the documentation for sub domains. I'm not using it with sub domains but everything else works except the install /upgrade of plugins and themes. |
Hi @flaviocopes @Sommerregen is there anything I can do to help on this? |
Hi @seandowney sorry I was on holiday for a long time. I've updated my server now to Grav v1.0.8 and my multisite setup is now running. Thus, I'm able to test the issue now and will report, when I have something for you to test. |
Hi @Sommerregen Ok great thank you |
@seandowney I can confirm the issue. Independent of your stream setup, Grav will always install plugins and themes to I have talked to @rhukster since it has to be changed on getgrav to use a stream locator like A really dirty fix for the moment would be to add if (isset($data['install_path'])) {
$path = preg_replace('~^user/~i', 'user://', $data['install_path']);
$data['install_path'] = self::getGrav()['locator']->findResource($path, false, true);
} |
@Sommerregen that's great, thanks for your time investigating, finding the cause and providing a temporary fix. Thanks very much |
The easiest work around we now use is to create symlinks for plugins, themes in sites. We do the same for pages/pagetrees from other sites we want to "reuse" in other sites. Since this only works in *nix systems the best longterm solution would be to support something like placeholders which could be resolved by grav and/or a global config which supports a resolution hierachy where to look for config similar to the language handling |
The instructions for Multisite installation are great but it seems that the Admin plugin doesn't install/update plugins or themes into the relevant directories for the site but just into the top level /user/plugins/ and /user/themes/ directories.
The text was updated successfully, but these errors were encountered: