13/13 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

------ ----------------------------------------------------------------------
Line modules/anonymous_publishing_cl/anonymous_publishing_cl.module
------ ----------------------------------------------------------------------
476 Call to deprecated function drupal_get_messages():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::all() or
\Drupal\Core\Messenger\MessengerInterface::messagesByType() instead.
502 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
544 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
552 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
588 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
596 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ ----------------------------------------------------------------------

------ ----------------------------------------------------------------------------------
Line modules/anonymous_publishing_cl/src/Controller/AnonymousPublishingController.php
------ ----------------------------------------------------------------------------------
19 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
41 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
46 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
100 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
111 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
116 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
123 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ ----------------------------------------------------------------------------------

------ --------------------------------------------------------------------------------
Line modules/anonymous_publishing_cl/src/Form/AnonymousPublishingClAdminBlocked.php
------ --------------------------------------------------------------------------------
158 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ --------------------------------------------------------------------------------

------ -----------------------------------------------------------------------------------
Line modules/anonymous_publishing_cl/src/Form/AnonymousPublishingClAdminModeration.php
------ -----------------------------------------------------------------------------------
116 Call to deprecated method getStatus() of class Drupal\comment\Entity\Comment:
in Drupal 8.3.0, will be removed before Drupal 9.0.0. Use
\Drupal\Core\Entity\EntityPublishedInterface::isPublished() instead.
130 Call to deprecated method url() of class Drupal\Core\Entity\EntityBase:
in Drupal 8.0.0, intended to be removed in Drupal 9.0.0
Please use toUrl() instead.
239 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ -----------------------------------------------------------------------------------

------ --------------------------------------------------------------------------------
Line modules/anonymous_publishing_cl/src/Form/AnonymousPublishingClAdminPrivacy.php
------ --------------------------------------------------------------------------------
151 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
159 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
163 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ --------------------------------------------------------------------------------

------ ---------------------------------------------------------------------------------
Line modules/anonymous_publishing_cl/src/Form/AnonymousPublishingClAdminSettings.php
------ ---------------------------------------------------------------------------------
60 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
68 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ ---------------------------------------------------------------------------------

------ -----------------------------------------------------------------------------
Line modules/anonymous_publishing_cl/src/Form/AnonymousPublishingClAdminSpam.php
------ -----------------------------------------------------------------------------
228 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ -----------------------------------------------------------------------------

------ -----------------------------------------------------------------------------------
Line modules/anonymous_publishing_cl/src/Form/AnonymousPublishingClAdminUnverified.php
------ -----------------------------------------------------------------------------------
238 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
285 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ -----------------------------------------------------------------------------------

------ -------------------------------------------------------------------------------
Line modules/anonymous_publishing_cl/src/Services/AnonymousPublishingClService.php
------ -------------------------------------------------------------------------------
24 Usage of deprecated trait Drupal\Core\Routing\UrlGeneratorTrait in class
Drupal\anonymous_publishing_cl\Services\AnonymousPublishingClService:
in Drupal 8.0.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Url instead.
172 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
179 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ -------------------------------------------------------------------------------

[ERROR] Found 28 errors

Comments

joy29 created an issue. See original summary.

rudranil29’s picture

StatusFileSize
new16.27 KB

patch for drupal 9 compatibility

rudranil29’s picture

Assigned: rudranil29 » Unassigned
Status: Active » Needs review
gisle’s picture

Status: Needs review » Needs work

Patch applies cleanly.

Installed patched version works OK.
Setting up permissions, etc. works OK.
Posting anonymously and verifying email works OK.

However, after doing, so, visiting the "Moderation" tab results in:

Recoverable fatal error: Object of class Drupal\Core\Url could not be converted to string in Drupal\Core\Url::fromUri() (line 281 of …/core/lib/Drupal/Core/Url.php) #0   
Warning: strpos() expects parameter 1 to be string, object given in Drupal\Core\Url::fromUri() (line 277 of …/core/lib/Drupal/Core/Url.php) #0 …/cor  
Warning: parse_url() expects parameter 1 to be string, object given in Drupal\Core\Url::fromUri() (line 272 of …/core/lib/Drupal/Core/Url.php) #0 …/  
Warning: preg_match() expects parameter 2 to be string, object given in Drupal\Core\Url::fromUri() (line 269 of …/core/lib/Drupal/Core/Url.php) #0 …  

The unpatched version of the project does not produce these errors.

rudranil29’s picture

Assigned: Unassigned » rudranil29
Status: Needs work » Needs review
rudranil29’s picture

Status: Needs review » Needs work
gisle’s picture

StatusFileSize
new16.24 KB

I've rerolled the patch in #2 to apply cleanly to the latest dev snapshot. It produces the same bugs as those reported in comment #4.

However, I've fixed some whitespace errors and non-Unix line endings in the codebase (see git log messages) since the patch in #2, so this version of the patch makes it easier to continue from patch in #2 with the latest dev-snapshot.

rudranil29’s picture

@gisle
In file "AnonymousPublishingClAdminModeration.php" I think this might be the error

if ($url) {
        $datatitle = array(
          '#type' => 'link',
          '#title' => Html::escape($title),
          '#url' => $url,
        );

should be look like this

 if ($url) {
        $datatitle = array(
          '#type' => 'link',
          '#title' => Html::escape($title),
          '#url' => $url->toRenderable(),
        );

  • gisle committed fc6cd99 on 8.x-1.x authored by joy29
    Issue #3072846 by joy29: Fixed Drupal 9 deprecated code
    
gisle’s picture

StatusFileSize
new872 bytes

Comment to #8.

No, but close. It put me on the right track, tho'.

The attached patch creates a valid string URL.

  • gisle committed 8be8d3d on 8.x-1.x
    Issue #3072846 by gisle: Fixed invalid URL to moderated item
    
gisle’s picture

Category: Bug report » Task
Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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