Can't apply upgrade because too many files(60%) were modified in Persons and Protean module
What to do about this:
Persons module: Check module hash: Can't apply upgrade because too many files(60%) were modified in Persons module
Protean module: Check module hash: Can't apply upgrade because too many files(77%) were modified in Protean module
I haven't changed modules files.....
In a Protean module there is "/modules/boonex/protean/updates/update_11.0.2_11.0.3/"
and in Persons module: "/modules/boonex/persons/updates/update_11.0.0_11.0.1/"
Other modules upgraded successfully.
-
- · Baloo
- ·
Hello, check this box and try to update again.
-
-
- · Baloo
-
·
In reply to Mayki
- ·
so I quote Anton L:
1. Go to Studio -> Settings -> Site Settings and enable 'Force auto-update, even if some files were modified' setting.
2. Edit inc/classes/BxDolInstallerUtils.php file, find the following line
define('BX_FORCE_AUTOUPDATE_MAX_CHANGED_FILES_PERCENT', 0.05);
and replace 0.05 with 0.99
3. Apply update from Studio -> Dashboard -> Version section.
NOTE!!! All your customizations will be overwritten in this case and most of them are corrupted. You may use this way if you are sure that all your changes aren't needed and can be restored.
-
- · Mayki
- ·
Problem solved!
I have solved upgrading problem due to hash failing by disabling "check_module_hash"
in a file: /studio/classes/BxDolStudioUpdater.php
here around line 31 by commenting out with double slash "//" :
// 'check_module_hash' => array( // 'title' => _t('_adm_txt_modules_check_module_hash'), // ),
and I just temporary removed the code for "check_module_hash " :
//--- Check hash ---//
removed code:
$aFiles = array(); $this->hashFiles(BX_DIRECTORY_PATH_ROOT . 'modules/' . $this->_aConfig['module_dir'], $aFiles); list($aFilesChanged, $fChangedPercent) = $this->hashCheck($aFiles, $aModuleInfo['id']); $bAutoupdateForceModifiedFiles = getParam('sys_autoupdate_force_modified_files') == 'on'; if(!empty($aFilesChanged) && !$bAutoupdateForceModifiedFiles) return array_merge($aResult, array( 'code' => BX_DOL_STUDIO_IU_RCE_MODIFIED, 'message' => $this->_displayResult('check_module_hash', false, '_adm_err_modules_module_was_modified', $bHtmlResponce), 'result' => false )); else if($fChangedPercent > BX_FORCE_AUTOUPDATE_MAX_CHANGED_FILES_PERCENT && $bAutoupdateForceModifiedFiles) return array_merge($aResult, array( 'code' => BX_DOL_STUDIO_IU_RCE_CHECKSUM_FAILED, 'message' => $this->_displayResult('check_module_hash', false, _t('_sys_upgrade_files_checksum_failed_too_many_module', round($fChangedPercent * 100), $aModuleInfo['title']), $bHtmlResponce), 'result' => false ));
After that upgrade of failing modules upgrade for Persons and Protean succeeded.
In Studio -> Apps Market I can now see:
Persons
BoonEx • 11.0.1and
Protean
Boonex • 11.0.3as expected.
I did that because I was 100% sure that I haven't change any modules files so it was strange why "Check hash " didn't pass.
I restored studio/classes/BxDolStudioUpdater.php after upgrade. -
- · Mayki
-
·
In reply to Baloo
- ·
Thank you Baloo , I knew that this setting exist but I couldn't remember where. I will use it next time if needed since it is easier then my solution as I described....
so I quote Anton L:
1. Go to Studio -> Settings -> Site Settings and enable 'Force auto-update, even if some files were modified' setting.
2. Edit inc/classes/BxDolInstallerUtils.php file, find the following line
define('BX_FORCE_AUTOUPDATE_MAX_CHANGED_FILES_PERCENT', 0.05);
and replace 0.05 with 0.99
3. Apply update from Studio -> Dashboard -> Version section.
NOTE!!! All your customizations will be overwritten in this case and most of them are corrupted. You may use this way if you are sure that all your changes aren't needed and can be restored.
-
- · Omar Amer
-
·
In reply to Mayki
- ·
interesting hack ! I love it. may I please see your site because you got me super curious as to having modified more than 40% of the protean code, and so on.. i wanna see what you ended up rolling out to the interwebs.
my site is www.mytribes.net in fairness and equinamity, whats yours? -
-
- · Omar Amer
-
·
In reply to Mayki
- ·
huh. thats interesting then. i'd not gotten that error. although i did add a line of code at the end of my inc/utils/ which ive now removed, because una wouldn't update without it, and i didnt understand the "force even if" option enough to know if it would modify (and strip) my addition, or how it would re-act..
i think una is running a "windows on windows" platform emulator of some sort.. which, worries me, because this kind of thing has a lot of security vulnerability eventually..
my clue was the C:/fakepath/.... type thing..
rule #1 if its not explicitly allowed, its denied/// of security, but things like php exec make holes for water with this..
(pardon, im drifting topically) i was just thinking about my surprise when i found undeletable attachments injected into my post editor here on una.io before i was even to click to compose a new post... -
-
·
Alex T⚜️
-
·
In reply to Mayki
- ·
It isn't correct hack, it's better to use official approach:
https://github.com/unaio/una/wiki/UpgradeFiles could be changed if you move to another hosting, or just moved files using FTP client. Also some editors could add some symbols if you opened some files for editing.
-
·
Alex T⚜️
-
- · russj85
- ·
Hello,
I have tried the official method and this mod with no success, when I click update it says it will update within a minute and never updates. trying to go from 12.0.1 to 12.1 and also having issues with nexus not installing. Can anyone assist?
-
-
·
LeonidS
-
·
In reply to russj85
R
- ·
Hello russj85 !
Possible this trouble has the same reasons as here https://una.io/page/view-discussion?id=8287
-
·
LeonidS