When updating with composer update --no-dev and php maintenance/update.php the following stack trace was produced. However, running php maintenance/update.php a second time, it passes without any problemas. I don't know if this is expected or not. I am just reporting in case of interest.
Error from line 74 of w/extensions/SemanticMediaWiki/src/SQLStore/TableBuilder/Examiner/CountMapField.php: Class 'SMW\Maintenance\UpdateEntityCountMap' not found
--- Post-creation examination ---------------------------------------------
Checking selected fixed properties IDs ...
... done.
Checking internal properties border ...
... space for internal properties allocated ... ✓
... done.
Checking predefined properties ...
... initialize predefined properties ...
... done.
Checking smw_hash field consistency ...
... updating the setup file key ... ✓
... done.
Checking smw_sortkey, smw_sort fields ...
... done.
Checking smw_touched field ...
... done.
Checking smw_countmap field consistency ...
... adding incomplete task for `smw_countmap` conversion ...
[f132b5a3e7df841908bf487a] [no req] Error from line 74 of w/extensions/SemanticMediaWiki/src/SQLStore/TableBuilder/Examiner/CountMapField.php: Class 'SMW\Maintenance\UpdateEntityCountMap' not found
Backtrace:
#0 w/extensions/SemanticMediaWiki/src/SQLStore/TableBuilder/TableBuildExaminer.php(161): SMW\SQLStore\TableBuilder\Examiner\CountMapField->check(array)
#1 w/extensions/SemanticMediaWiki/src/SQLStore/Installer.php(240): SMW\SQLStore\TableBuilder\TableBuildExaminer->checkOnPostCreation(SMW\SQLStore\TableBuilder\MySQLTableBuilder)
#2 w/extensions/SemanticMediaWiki/src/SQLStore/SQLStore.php(448): SMW\SQLStore\Installer->install(SMW\Options)
#3 w/extensions/SemanticMediaWiki/src/Store.php(489): SMW\SQLStore\SQLStore->setup(SMW\Options)
#4 w/includes/installer/DatabaseUpdater.php(489): SMW\Store::setupStore(boolean, SMW\Options)
#5 w/includes/installer/DatabaseUpdater.php(457): DatabaseUpdater->runUpdates(array, boolean)
#6 w/maintenance/update.php(203): DatabaseUpdater->doUpdates(array)
#7 w/maintenance/doMaintenance.php(96): UpdateMediaWiki->execute()
#8 w/maintenance/update.php(275): require_once(string)
#9 {main}
Unfortunately I did not record wich SMW "revision" I was using before updating it, it was also 3.2.0-alpha.
UPDATE: I know I should not be using an alpha version. It is not in a production environment.
Class 'SMW\Maintenance\UpdateEntityCountMap' not found
Most likely caused by [0] and the renaming of UpdateEntityCountMap to updateEntityCountMap.
Would changing of following lines help in CountMapField.php?
@@ -4,11 +4,11 @@ namespace SMW\SQLStore\TableBuilder\Examiner;
use Onoi\MessageReporter\MessageReporterAwareTrait;
use SMW\SQLStore\SQLStore;
use SMW\SQLStore\TableBuilder;
use SMW\SetupFile;
-use SMW\Maintenance\UpdateEntityCountMap;
+use SMW\Maintenance\updateEntityCountMap as UpdateEntityCountMap;
use SMW\Utils\CliMsgFormatter;
The error is already gone when running update.php a second time.
The error is already gone when running update.php a second time.
The check for the count map and the access to the UpdateEntityCountMap::COUNTMAP_INCOMPLETE constant only appears once when it is a new field.
I'm on Windows so I cannot verify the issue. Now, best way the verify the issue is by removing the field smw_countmap from the ..._aux table and run setupStore.php again and see what happens.
Ok, I will try that.
Yes! It fixes the issue. Thanks @mwjames :+1:
We have a similar case in [0] which requires the same treatment (use SMW\Maintenance\populateHashField as PopulateHashField;).
I wonder if this is the only maintenance script affected. Basically all class names for the maintenance script were changed.
Most helpful comment
We have a similar case in [0] which requires the same treatment (
use SMW\Maintenance\populateHashField as PopulateHashField;).[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/src/SQLStore/TableBuilder/Examiner/HashField.php#L7