e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
321 stars 213 forks source link

what can be reason that installed plugin list is still changing #4242

Closed Jimmi08 closed 3 years ago

Jimmi08 commented 3 years ago

I have the latest version of e107- No outdated plugins (in meaning no version 1 updated) Just a lot of custom plugins but build in more cases with plugin builder.

I noticed this too often, but I don't know where to look.

I installed a new plugin, configure, I can see it works on the frontend. But then after some time, this plugin is listed under not installed plugins (but frontend still works),

Where to look and what to check?

Thanks

CaMer0n commented 3 years ago

@Jimmi08 Check your e107_plugin database table. Do the plugin_id values look normal, or are they excessively high?

Jimmi08 commented 3 years ago

@CaMer0n Do you mean this?

image

their flag is uninstalled (0)

That one with ID 1246 was installed yesterday.

CaMer0n commented 3 years ago

@Jimmi08 Yes. You might want to add some additional logging in plugin_class.php to see what is going on. Particularly in this area:

https://github.com/e107inc/e107/blob/3587075b963cf9b76abae46bb3a27107a74e46dc/e107_handlers/plugin_class.php#L578

CaMer0n commented 3 years ago

@Jimmi08 This can also happen if you accidentally point to another installation using $E107_CONFIG = array('site_path' => 'whatever'); inside your e107_config.php file. It will load the cached Prefs from that folder and possibly overwrite your database settings.

Jimmi08 commented 3 years ago

@CaMer0n
There are two e107 installations on 2 different domains, that are using the same database and the hash folder with the same name. One is active, new plugins added, etc. The second one is not used, but I left files there because other CMS there uses class2.php to be able to use e107 functionality and e107 tables it used before.

I can't get my head around fact that some cached file is overriding the database table.

I am on active domain, I install the plugin, the database is changed, then cached to cached prefs... everything is ok. Then on other domain with outdated cached file database core table is changed because of cached prefs file? When does this happen? Only in the admin area or anytime the page with included class2.php is displayed? I know that this is non standard situation, I am just trying to understand how it works to be able to fix it.

CaMer0n commented 3 years ago

@Jimmi08 I believe it is pulling the installed plugin list pref plug_installed from the cached prefs file. This is what is checked by the plugin handler.

You might want to try disabling line 427 in the pref_class.php and see if that helps?:

$this->pref_cache = e107::getArrayStorage()->serialize($data, false); //runtime cache
Jimmi08 commented 3 years ago

@CaMer0n I think that this is the reason: https://github.com/e107inc/e107/issues/4333

After I started to copy plugin code to other installations too (without installation, that site is not available to log in), the plugin list is stable for now (tested with 2.3.0).

Jimmi08 commented 3 years ago

Answered: it is loaded from the cached version plugin list and the database is changed according to it. It is not a problem if you use only one site.