Problem/Motivation

Upgrade command always returns weird warning:

C:\Users\Mike\Sites\8>drush dmu-upgrade styleswitcher
Indexing...done.
styleswitcher does not implement hook_Array.                           [warning]

I guess the problem is in that some code attempts to convert array with hooks to string.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pingwin4eg created an issue. See original summary.

pingwin4eg’s picture

Priority: Normal » Minor

Setting priority to minor because this warning does not prevent the upgrading.

pingwin4eg’s picture

Priority: Minor » Normal

Though... blocks are not getting converted.

C:\Users\Mike\Sites\8>drush dmu-upgrade styleswitcher --only=blocks --debug
............................
Indexing...done.
Executing plugin: blocks [34.25 sec, 25.82 MB]                          [notice]

Array to string conversion DrushLog.php:73 [34.32 sec, 25.87 MB]        [notice]

styleswitcher does not implement hook_Array. [34.33 sec, 25.87 MB]     [warning]

Returned from hook drush_drupalmoduleupgrader_dmu_upgrade [34.34 sec,    [debug]

25.85 MB]
pingwin4eg’s picture

Here's something that made progress for me.

NickDickinsonWilde’s picture

I'd prefer a warning on each function and then still try to convert the other functions. Patch attached, that does that. (to be exact, created that before noticing this issue already existed).

Prashant.c’s picture

Priority: Normal » Major
Status: Needs review » Needs work

This patch no longer applies to latest version of the module but error still occurs when trying to upgrade a module which defines block.

Gerhard Roth’s picture

I get a similar warning:

[warning] seedshop does not implement hook_@hook.
 

I didn't try a patch

HongPong’s picture

Status: Needs work » Needs review
FileSize
988 bytes

Hi all,
Here is a Re-roll against head. i'm going to try it and see if it seems to work. Note that we would still likely get 20 test failures with this patch.

Status: Needs review » Needs work

The last submitted patch, 8: 2598934-8-blockprocessing.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

HongPong’s picture

Status: Needs work » Needs review

without debug flag i got an improvement

styleswitcher does not implement hook_block_configure.                                                                                     [warning]
Use of undefined constant DRUPAL_CACHE_PER_PAGE - assumed 'DRUPAL_CACHE_PER_PAGE' (this will throw an Error in a future version of PHP)    [warning]
ConverterBase.php(73) : eval()'d code:13
styleswitcher does not implement hook_block_save.                                                                                          [warning]
styleswitcher_block_view cannot be executed because it contains logic.                                                                     [warning]
Invalid placeholder (!hook) in string: @FIXME                                                                                              [error]
hook_!hook is gone in Drupal 8.

It has been left here by the Drupal Module Upgrader so that you can move its
logic into the appropriate block plugins, which should be in the
src/Plugin/Block directory. Once all logic is moved into the plugins, delete
this hook.

@see https://www.drupal.org/node/1880620 FormattableMarkup.php:242
Invalid placeholder (!hook) in string: @FIXME                                                                                              [error]
hook_!hook is gone in Drupal 8.

It has been left here by the Drupal Module Upgrader so that you can move its
logic into the appropriate block plugins, which should be in the
src/Plugin/Block directory. Once all logic is moved into the plugins, delete
this hook.

@see https://www.drupal.org/node/1880620 FormattableMarkup.php:242

I put the more verbose debugger log here. i think it is working better now and is probably RTBC. If you can get drush 8 running I suggest you try it.
https://gist.github.com/HongPong/acd858ae2f46be46e7c91a4b76228144

DanChadwick’s picture

I am using drush 8 and #8 seems to fix the problem.

solideogloria’s picture

Status: Needs review » Reviewed & tested by the community

I had a problem similar to #7, and the patch in #8 fixes it for me. I am using Drush version 8.1.17

solideogloria’s picture

I still have the issue if the patch is not included when using Drush 10.3 and Drupal 8.9. Can we get this committed, please?

The patch still works.

  • jcnventura committed 34236a7 on 8.x-1.x authored by HongPong
    Issue #2598934 by pingwin4eg, HongPong, NickDickinsonWilde,...
jcnventura’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

joseph.olstad’s picture

Status: Closed (fixed) » Needs work

This change may have broken our tests, there was a commit made November 4th that broke our tests. see the following issues and links:


4 Nov 2020 at 04:27 EST

PHP 7.1 & MySQL 5.5, D8.9 Composer require failure

18 Sep 2019 at 10:45 EDT

PHP 7.1 & MySQL 5.5, D8.7 242 pass

Other changes that were made November 4th that may have caused this:

#3165948: License "GPL-2.0+" is a deprecated SPDX license identifier, use "GPL-2.0-or-later" instead

#3069566: Prevent running module upgrader on a module that already has an info.yml file

#3081813: Add drush 10 support

joseph.olstad’s picture

Status: Needs work » Fixed

actually it was probably not THIS issue but one of the others, the drush 10 support or the License change 3165948

joseph.olstad’s picture

fix automated tests, broken with changes made November 4th 2020

#3183927: Fix automated tests, broken since November 4th 2020

Proposed resolution / Remaining Tasks

make a patch that reverts all changes made november 4th and see if it fixes the tests.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.