44/44 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

------ -----------------------------------------------------------------------
Line amp.install
------ -----------------------------------------------------------------------
166 Call to deprecated method entityManager() of class Drupal:
in drupal:8.0.0 and is removed from drupal:9.0.0.
Use \Drupal::entityTypeManager() instead in most cases. If the needed
method is not on \Drupal\Core\Entity\EntityTypeManagerInterface, see
the
deprecated \Drupal\Core\Entity\EntityManager to find the
correct interface or service.
205 Call to deprecated method entityManager() of class Drupal:
in drupal:8.0.0 and is removed from drupal:9.0.0.
Use \Drupal::entityTypeManager() instead in most cases. If the needed
method is not on \Drupal\Core\Entity\EntityTypeManagerInterface, see
the
deprecated \Drupal\Core\Entity\EntityManager to find the
correct interface or service.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Lilit_Ghazaryan created an issue. See original summary.

Lilit_Ghazaryan’s picture

Status: Active » Needs review
FileSize
1.49 KB
Berdir’s picture

Status: Needs review » Needs work

Seeing this with drupal-check:

 ------ ------------------------------------------------------------------------------------------------------------------------ 
  Line   tests/src/Functional/AmpTestBase.php                                                                                    
 ------ ------------------------------------------------------------------------------------------------------------------------ 
  16     Usage of deprecated trait Drupal\simpletest\ContentTypeCreationTrait in class Drupal\Tests\amp\Functional\AmpTestBase:  
         in drupal:8.4.0 and is removed from drupal:9.0.0. Use                                                                   
         \Drupal\Tests\node\Traits\ContentTypeCreationTrait instead.                                                             
 ------ ------------------------------------------------------------------------------------------------------------------------ 

And this when running the tests I get:

  48x: There is no `base theme` property specified in the amptheme.info.yml file. The optionality of the `base theme` property is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. All Drupal 8 themes must add `base theme: stable` to their *.info.yml file for them to continue to work as-is in future versions of Drupal. Drupal 9 requires the `base theme` property to be specified. See https://www.drupal.org/node/3066038
    24x in AmpBodyTransformTest::testAmpBodyTransform from Drupal\Tests\amp\Functional
    24x in AmpViewModeTest::testAmpViewMode from Drupal\Tests\amp\Functional

  10x: drupal_http_header_attributes() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Render\HtmlResponseAttachmentsProcessor::formatHttpHeaderAttributes() instead. See https://www.drupal.org/node/3000051
    5x in AmpBodyTransformTest::testAmpBodyTransform from Drupal\Tests\amp\Functional
    5x in AmpViewModeTest::testAmpViewMode from Drupal\Tests\amp\Functional

  8x: Duplicate key "core/drupal.dialog.off_canvas" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since Symfony 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line 101.
    4x in AmpBodyTransformTest::testAmpBodyTransform from Drupal\Tests\amp\Functional
    4x in AmpViewModeTest::testAmpViewMode from Drupal\Tests\amp\Functional

  8x: Duplicate key "css/components/toolbar.css" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since Symfony 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line 31.
    4x in AmpBodyTransformTest::testAmpBodyTransform from Drupal\Tests\amp\Functional
    4x in AmpViewModeTest::testAmpViewMode from Drupal\Tests\amp\Functional

  8x: Duplicate key "core/drupal.dialog.off_canvas" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since Symfony 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line 141.
    4x in AmpBodyTransformTest::testAmpBodyTransform from Drupal\Tests\amp\Functional
    4x in AmpViewModeTest::testAmpViewMode from Drupal\Tests\amp\Functional

  4x: Automatically creating the first item for computed fields is deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\TypedData\ComputedItemListTrait instead.
    2x in AmpBodyTransformTest::testAmpBodyTransform from Drupal\Tests\amp\Functional
    2x in AmpViewModeTest::testAmpViewMode from Drupal\Tests\amp\Functional

  3x: Drupal\simpletest\ContentTypeCreationTrait is deprecated in Drupal 8.4.x. Will be removed before Drupal 9.0.0. Use \Drupal\Tests\node\Traits\ContentTypeCreationTrait instead. See https://www.drupal.org/node/2884454.
    1x in ClassLoader::loadClass from Composer\Autoload
    1x in AmpBodyTransformTest::testAmpBodyTransform from Drupal\Tests\amp\Functional
    1x in AmpViewModeTest::testAmpViewMode from Drupal\Tests\amp\Functional

  2x: Drupal\Tests\BrowserTestBase::$defaultTheme is required in drupal:9.0.0 when using an install profile that does not set a default theme. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use.
    1x in AmpBodyTransformTest::testAmpBodyTransform from Drupal\Tests\amp\Functional
    1x in AmpViewModeTest::testAmpViewMode from Drupal\Tests\amp\Functional

  2x: drupal_installation_attempted() is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Installer\InstallerKernel::installationAttempted() instead. See https://www.drupal.org/node/3035275
    1x in AmpBodyTransformTest::testAmpBodyTransform from Drupal\Tests\amp\Functional
    1x in AmpViewModeTest::testAmpViewMode from Drupal\Tests\amp\Functional

I think most of these are actually from dependencies, $defaultTheme needs to be taken care of, the trait was already mentioned above. The duplicate keys are afaik in amptheme and the rest is from metatag. There is already #3106310: Property 'base theme' needs to be set, the two patches should probably be tested together including the D9 patch for metatag and then we should be able to get that list to zero.

Berdir’s picture

Another issue here is that lullabot/amp still is not compatible with a more recent version of masterminds/html5, so we might want to try a PR on github for that.

I'm not sure why these two commits weren't done yet and why this module doesn't require ^1.1.4 of lullabot/amp because as far as I see, it will currently still install an older version that claims to be compatible with masterminds/html5 when it really isn't.

karishmaamin’s picture

Status: Needs work » Needs review
FileSize
1.09 KB

Please review the code.

Berdir’s picture

Status: Needs review » Needs work

Looks like that patch is only the interdiff, you need to post a full patch.

And the base theme definition doesn't belong in here, this is a module. It needs to be combined with the related issue for the amptheme project that I referenced above.

I'd also avoid changing composer.json at this point, drupal.org will take care of that now.

Berdir’s picture

Title: DRupal 9 deprecated code report » Drupal 9 deprecated code report
Samvada_Jain_M’s picture

Status: Needs work » Needs review
FileSize
461 bytes
Samvada_Jain_M’s picture

Status: Needs review » Needs work
Suresh Prabhu Parkala’s picture

Status: Needs work » Needs review
FileSize
1.19 KB

Please review the patch.

KarenS’s picture

The code in the #10 patch is fixed in #3146122: Automated Drupal 9 compatibility fixes. Still need to address other deprecations the test indicated.

KarenS’s picture

The base theme is not set in this module, it's set in the theme. Amptheme has a new release that sets that. Tests should now pull that theme, getting rid of that message. I did some other fixes to the test requirements yesterday and today in another issue that should fix a few other errors.

KarenS’s picture

Here's what I see still to fix, let's see what testbot says.

KarenS’s picture

Berdir’s picture

+++ b/composer.json
@@ -11,14 +11,14 @@
     "drupal/schema_metatag": "^1.0",
-    "drupal/token": "^1.0"
+    "drupal/token": "^1.0",
+    "masterminds/html5": "~2.3.0"
...
     "sebastian/diff": "^1.2 || ^2 || ^3",

.

+++ b/composer.json
@@ -11,14 +11,14 @@
   "require": {
-    "lullabot/amp": "^1.0.0",
+    "lullabot/amp": "^1.1.4",
     "drupal/schema_metatag": "^1.0",
-    "drupal/token": "^1.0"
+    "drupal/token": "^1.0",
+    "masterminds/html5": "~2.3.0"
   },
   "require-dev": {

I think lullabot/amp will need to be updated to require and be compatible with mastermind/html5 2.7.

I've been pushing back on updating the version for quite some time knowing that this will cause problems here, but there have for example been lots of performance improvements that I'm sure will be helpful have.

KarenS’s picture

KarenS’s picture

Let's see if we can get everything else working and separate that issue out. I don't have time to update the library ATM and nobody else has stepped up either.

KarenS’s picture

KarenS’s picture

That passed, add some code cleanup.

KarenS’s picture

Found one more fix.

KarenS’s picture

Looks like the other changes are working and tests pass. I created a separate tracking issue for the library fix, #3154863: Update masterminds/html5 version in AMP library.

  • KarenS committed 6ca366e on 8.x-3.x
    Issue #3112167 by KarenS, Lilit_Ghazaryan, Samvada_Jain_M, karishmaamin...
KarenS’s picture

Status: Needs review » Fixed
Berdir’s picture

@KarenS: The test configuration against D9 should be updated to PHP 7.3 as that's the minimum version for Drupal 9: https://www.drupal.org/pift-ci-job/1737564

Status: Fixed » Closed (fixed)

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