Skip to content
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

Installing of downloaded plugins #643

Closed
stephanbrunker opened this issue Oct 3, 2019 · 5 comments
Closed

Installing of downloaded plugins #643

stephanbrunker opened this issue Oct 3, 2019 · 5 comments

Comments

@stephanbrunker
Copy link
Contributor

Atm, I am creating a real sidebar extension for the customarchive plugin, but I cannot install it. Installing plugins via Spartacus works fine, but in https://docs.s9y.org/docs/users/using/using-plugins.html the installation of external plugins is described as simply as copying it into the /plugins folder:

Downloading a plugin
You can download the plugin you want from our Spartacus site. All plugins listed there will have a handy download link.
A plugin always consists of a single directory like “serendipity_event_trackback” with at least one file in it. If you use the ViewCVS facility you can click on each single file and then on the following page click on the first “Download” link which fetches the latest version of that file. Save that file on your Serendipity installation and place them all into a subdirectory of your /plugins directory. First create a directory with the same name as the plugin (“serendipity_event_trackback”). Then save the file “serendipity_event_trackback.php” inside that directory.
After you have downloaded all files you can go to your Serendipity Plugin manager and on the list of available plugins you will see your latest acquired plugin. :-)
The same applies when having downloaded our Netmirror Snapshot file. Just extract the tarball somewher and copy the files and directory you want to your /plugins subdirectory of the Serendipity installation.

But unfortunately, nothing happens. Looking at the code of /include/admin/plugins.inc.php there cannot because by just opening the page, the enum_plugin_classes is not triggered and because of that no automatic installation. So: what can I do to at least manually install my plugin for testing?

@stephanbrunker
Copy link
Contributor Author

I found a workaround by manually enter a GET addnew in the code and outcommenting the XRSF protection for this one operation. Another would be to enter the plugin manually in the database with an generated uniqid. The question remains if that part of the manual should be updated that it is not possible to install plugins by creating subdirectories of /plugins or if the plugin code should be updated that plugins are installed automatically.

@onli
Copy link
Member

onli commented Oct 4, 2019

Hi Stephan. I'm not sure yet the workflow was clear to you. Normally, you create a new plugin (with new constructorname etc) and place it under plugins/. Then it won't appear in the pluginlist, but it will be listed as an install option when you select Install plugin. Then you can install it and will be loaded.

That worked for years, are you certain this is broken now?

@stephanbrunker
Copy link
Contributor Author

stephanbrunker commented Oct 5, 2019

Okay, I thought that the 'install plugin' button only connects to the Spartacus page. I couldn't do that because I get an error:

Die URL https://raw.github.com/s9y/additional_plugins/master/package_sidebar_de.xml (IP 151.101.112.133) konnte nicht geöffnet werden. Möglicherweise existieren Server- oder Netzwerkprobleme.
Fatal error: Uncaught Error: Call to a member function getStatus() on null in /var/www/s9y/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php:458 Stack trace: #0 /var/www/s9y/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php(641): serendipity_event_spartacus->fetchfile('https://raw.git...', '/var/www/s9y/te...', 43200, true) #1 /var/www/s9y/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php(1303): serendipity_event_spartacus->fetchOnline('sidebar') #2 /var/www/s9y/include/plugin_api.inc.php(1139): serendipity_event_spartacus->event_hook('backend_plugins...', Object(serendipity_property_bag), Array, NULL) #3 /var/www/s9y/include/admin/plugins.inc.php(166): serendipity_plugin_api::hook_event('backend_plugins...', Array) #4 /var/www/s9y/serendipity_admin.php(131): include('/var/www/s9y/in...') #5 {main} thrown in /var/www/s9y/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php on line 458

But this error is most likely due to the fact that I just copied my s9y installation from the webserver to the development server without a full install, only changing a few values in the configuration to get it running. Or a configuration problem on the server, because it works online. So, I don't think it is broken.

@onli
Copy link
Member

onli commented Oct 5, 2019

I had the same misconception in the beginning :)

@stephanbrunker
Copy link
Contributor Author

stephanbrunker commented Oct 6, 2019

Oh, and I fixed the issue now. If outgoing connections are blocked by the server, the httpRequest in event_spartacus throws an exception and then the exception handler tried $response->getStatus() on a null object. Fixed that with an isset() check and now I can install plugins offline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants