Problem/Motivation

Getting the following error when trying to generate SEO report on a simple content type with simple fields in Drupal CMS

TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given, called in /var/www/html/web/core/lib/Drupal/Component/Render/FormattableMarkup.php on line 238 in Drupal\Component\Utility\Html::escape() (line 431 of /var/www/html/web/core/lib/Drupal/Component/Utility/Html.php).

Steps to reproduce

Try to generate an SEO report on a simple content type on Drupal CMS

Proposed resolution

NA

Remaining tasks

NA

User interface changes

NA

API changes

NA

Data model changes

Issue fork ai_seo-3507760

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

  • 1.x Comparechanges, plain diff MR !3

Comments

vivek panicker created an issue. See original summary.

vivek panicker’s picture

Status: Active » Needs review
prashant.c’s picture

Thanks for the fix @vivek panicker I faced the same issue and applying the changes fixed it for me on Drupal 11.x.

However getting $url always empty https://git.drupalcode.org/project/ai_seo/-/merge_requests/3/diffs#529cdd96345bf7dcbbce6cbd38ccb30984c74ed4_232_229, maybe we could create another issue to address the URL not generating part.

vivek panicker’s picture

StatusFileSize
new111.6 KB

@prashant.c I do see an instance where we are passing $url.
alt

So I don't think that can be removed now.

Also if the current patch is working for you, can you help move the issue to RTBC please?

a.dmitriiev’s picture

Status: Needs review » Reviewed & tested by the community

Method analyzeHtml allows $url as NULL. So it is reasonable to check the variable before using it. And the other saveReport method that is executed with this variable also allows it to be NULL. So, I think the MR should be merged. RTBC.

a.dmitriiev’s picture

StatusFileSize
new978 bytes

Uploading the patch, so that it can be easily used in composer projects.

a.dmitriiev’s picture

Priority: Normal » Major

I think as this issue prevents module features from being used, the priority should be raised to "Major", maybe even to "Critical" at some point.

doxigo’s picture

Version: 1.0.0-beta2 » 1.0.0-beta3
Priority: Major » Critical

The same applies to beta3, bumping to "Critical" and the version. The patch does fix the problem otherwise the module does not work at all.

j-vee’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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