Hi,

Problem
I just upgrade my Drupal 8 beta15 site to Drupal 8 RC1 (Danish Version). All seems fine except while upgrading got warning (Filters missing).

Now when I tried to configure or try to place any block got this error.

"Recoverable fatal error: Object of class Drupal\Core\Annotation\Translation could not be converted to string in Drupal\Component\Utility\Xss::filter() (line 72 of core/lib/Drupal/Component/Utility/Xss.php)."

Does any one have solution or same issue?

Comments

mudassar774 created an issue. See original summary.

vorapoap’s picture

I have the same problem.. upgraded from beta15 to RC2
For me, it happens when I try to place any block in to any regions (/admin/structure/block)

vorapoap’s picture

Hmm added this to
/core/lib/Drupal/Core/Annotation/Translation.php
seems to fix the problem

  public function __toString() {
    return $this->translation->__toString();
  }

Is this a core bug that should be fixed?

vorapoap’s picture

Version: 8.0.0-rc1 » 8.0.x-dev
Priority: Normal » Major

This is still a problem in Drupal8.0 version
How to propose this into CORE ?
I get lots of this error in php-fpm.d and this can simply fixed by adding __toStrnig to translation object

[23-Nov-2015 17:07:30 Asia/Bangkok] Recoverable fatal error: Object of class Drupal\Core\Annotation\Translation could not be converted to string in /redesign/connect/core/lib/Drupal/Component/Utility/Xss.php on line 72

Berdir’s picture

Status: Active » Postponed (maintainer needs more info)

Does the error also say where it is called?

Can you post the output of the following, place it where Xss::filter() is called:

if (is_object($the_argument)) {
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
}

Also, do you know what string this is, you could print that out also in your __toString()?

umakart’s picture

Same here in 8.0.1 (new installation)
No way to get to the Block configuration page => The website encountered an unexpected error.
And error output mentioned above.
#3 fixed the problem for me, but Core hack!

TrexaSolutions’s picture

Version: 8.0.x-dev » 8.0.1
Status: Postponed (maintainer needs more info) » Fixed

I had the same problem with a new installation with 2 translations lenguages available. I'm not sure if this could also affect the situation.
#3 Solved the problem just adding the function to /core/lib/Drupal/Core/Annotation/Translation.php.
I hope this fix is included in upcoming releases. Thanks Vorapoap for your help!

dpi’s picture

Version: 8.0.1 » 8.0.x-dev
Status: Fixed » Postponed (maintainer needs more info)

Reverted

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

pameeela’s picture

Component: translation_entity.module » ajax system
Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
Issue tags: +Bug Smash Initiative

Thanks for reporting this issue. We rely on issue reports like this one to resolve bugs and improve Drupal core.

As part of the Bug Smash Initiative, we are triaging issues that are marked "Postponed (maintainer needs more info)".

Since there were no specific steps to reproduce the issue provided since the issue was postponed in 2015, I'm marking the issue "Closed (cannot reproduce)". If anyone can provide complete steps to reproduce the issue (starting from "Install Drupal core"), document those steps in the issue summary and set the issue status back to "Active".

Thanks!