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

The table of available updates seems wrong for post updates #5184

Closed
Pasqualle opened this issue Jul 18, 2022 · 2 comments
Closed

The table of available updates seems wrong for post updates #5184

Pasqualle opened this issue Jul 18, 2022 · 2 comments

Comments

@Pasqualle
Copy link
Contributor

Describe the bug
This is my output of drush updb (same with drush updbst):

 -------------- ------------------------------ --------------- ---------------------------------------
  Module         Update ID                      Type            Description
 -------------- ------------------------------ --------------- ---------------------------------------
  bupo_teasers   9000                           hook_update_n   9000 - Create bupo_teasers field.
  Update node_reference paragraphs.sers_field   post-update
 -------------- ------------------------------ --------------- ---------------------------------------

The post update description seems to be displayed in the wrong column.

To Reproduce
This is my post update hook declaration (in bupo_teasers.post_update.php) :

/**
 * Update node_reference paragraphs.
 */
function bupo_teasers_post_update_6_test_migrate_teasers_field(&$sandbox) {

Expected behavior
The post-update should be correctly listed. Update description in the last column.

Actual behavior
see the description

Workaround
update.php shows the list of update descriptions correctly.

System Configuration

Q A
Drush version? 10.6.2
Drupal version? 9.3.18
PHP version 8.0.19
OS? Ubuntu (with WSL2)

Additional information
UpdateDBCommands.php#L609
Trying to hard code the description like
'description' => 'X',
then the output is correct, the description X is displayed in the last column.

@Pasqualle
Copy link
Contributor Author

The source of the problem is windows style line ends used in the post_update file.
Switching to linux line ends solves this issue (without needing to change anything in drush).

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Update%21UpdateRegistry.php/function/UpdateRegistry%3A%3AgetPendingUpdateInformation/9.3.x
This getPendingUpdateInformation() does not remove \r from the doc comment, and results in the broken table display.

@Pasqualle
Copy link
Contributor Author

I think this bug can be closed as developer not following coding standards.
https://www.drupal.org/docs/develop/standards/coding-standards

Files should be formatted with \n as the line ending (Unix line endings), not \r\n (Windows line endings).

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

1 participant