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

AbstractService::getResultMessage does not print intended messages #70

Open
dneuge opened this issue Jul 13, 2015 · 1 comment
Open

Comments

@dneuge
Copy link
Contributor

dneuge commented Jul 13, 2015

AbstractService::getResultMessage takes two arguments, $status and $message, which are both null by default. When trying to print an error message with just $status set (as e.g. MigrateRelationsService does) only $status is printed because $message has already been overridden by LocalizationUtility::translate('moveAlong', 'dam_falmigration').

Furthermore, to actually print an error message, amountOfMigratedRecords has to be set to a negative value, else default messages (migrationSuccessful & migratedFiles or migrationNotNecessary & allFilesMigrated) will be used instead of the requested headline & message.

This looks unintended as e.g. MigrateRelationsService has not been written that way. How were error messages supposed to be working?

Plus, if $message was not overridden early on, the translation key would still be wrong as the dot after migrationStatusMessage prefix is missing:

$message = LocalizationUtility::translate('migrationStatusMessage' . $status, 'dam_falmigration');

@Tuurlijk
Copy link

Yes, this is a mess. The method tries to do too much. It should be refactored into at least an error message and a regular message.

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