1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-23 16:01:39 +02:00

Fixes #5483 Extended User field not being restored when 'repair plugin' is activated.

This commit is contained in:
camer0n
2025-04-29 07:59:46 -07:00
parent 987e7cf966
commit 45d9f48580
2 changed files with 28 additions and 17 deletions

View File

@@ -4222,6 +4222,7 @@ class e107plugin
{
case 'install': // Add all active extended fields
case 'upgrade':
case 'refresh':
if (!$remove)
{

View File

@@ -468,6 +468,33 @@
$this->pluginUninstall('tagcloud');
}
public function testRefreshExtendedFields()
{
$this->pluginInstall('_blank');
$count = e107::getDb()->count('user_extended_struct', '(*)', "user_extended_struct_name LIKE 'plugin__blank_custom%'");
$this::assertEquals(1, $count, 'Field was not installed');
$this->pluginRefresh('_blank');
$count = e107::getDb()->count('user_extended_struct', '(*)', "user_extended_struct_name LIKE 'plugin__blank_custom%'");
$this::assertEquals(1, $count, 'Field was duplicated or is missing');
e107::getDb()->delete('user_extended_struct', "user_extended_struct_name LIKE 'plugin__blank_custom%'");
$count = e107::getDb()->count('user_extended_struct', '(*)', "user_extended_struct_name LIKE 'plugin__blank_custom%'");
$this::assertEquals(0, $count, 'Field was not deleted');
$this->pluginRefresh('_blank');
$count = e107::getDb()->count('user_extended_struct', '(*)', "user_extended_struct_name LIKE 'plugin__blank_custom%'");
$this::assertEquals(1, $count, 'Field was not re-installed');
$this->pluginUninstall('_blank');
}
/*
public function testThirdParty()
{
@@ -520,23 +547,6 @@
}*/
public function testVstore()
{
if(!is_dir(e_PLUGIN."vstore"))
{
return ;
}
$this->pluginInstall('vstore');
$this->pluginRefresh('vstore');
$links = e107::getDb()->retrieve('links', '*', 'link_owner = "vstore"', true);
$this->assertNotEmpty($links);
$this->assertCount(2, $links);
$this->pluginUninstall('vstore');
}
public function testplugInstalledStatus()
{