Hello! sometimes I see in the logs the error:
Notice: Undefined index: include_images in web/modules/contrib/simple_sitemap/src/Batch/EntityUrlGenerator.php line 66

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Saphyel created an issue. See original summary.

Saphyel’s picture

Assigned: Saphyel » Unassigned
Status: Active » Needs review
FileSize
813 bytes

Status: Needs review » Needs work

The last submitted patch, 2: include_images-2913507-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

gbyte’s picture

Status: Needs work » Closed (works as designed)

If you ran /update.php after updating the module, all bundle config settings and entity overrides should have the setting 'include_images', which should make checking for isset() redundant. If you encounter this error after running update.php, please reinstall the module and report back if the error returns.

gbyte’s picture

Status: Closed (works as designed) » Active
Rajab Natshah’s picture

Status: Active » Needs work

Having the same issue with PHP7.1

Rajab Natshah’s picture

This patch file for the latest "drupal/simple_sitemap": "2.x-dev#4febc8925dc815a41c360e94c651e6cbb88e5aa4"

Rajab Natshah’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

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

Rajab Natshah’s picture

Do we have to update the automated tests?

Rajab Natshah’s picture

This patch for "drupal/simple_sitemap": "2.10"

gbyte’s picture

Status: Needs work » Active

@RajabNatshah Please only create patches for the dev version. We cannot patch 2.10 retroactively - this is probably why tests are failing.

Also as stated in comment #4, this error should not exist if the module has been updated properly. Please install dev version and run update.php. If the error still exists, please try to check

- if one of the simple_sitemap.bundle_settings.[entity_type][bundle] configs is missing the 'exclude_images' key. If that's the case, go to that bundle setting page and disable and reenable the sitemap for that bundle.

- If however all bundle configs are OK, probably some entity override in the table simple_sitemap_entity_override misses the key. In this case, you will have to either delete/resave the override, or disable and then reenable the entity type in 'admin/config/search/simplesitemap/entities', but bear in mind this will delete your sitemap settings for all bundles of that type and delete all entity overrides.

Rajab Natshah’s picture

Noted:
I have a case when we enable the module in a profile and PHP7.1

Posted 2 patches:

  • 2913507-7.patch for "drupal/simple_sitemap": "2.x-dev#4febc8925dc815a41c360e94c651e6cbb88e5aa4"
  • simple_sitemap-210--2913507-11.patch for "drupal/simple_sitemap": "2.10"

As I'm using the other patch for 2.10 in a profile, which is a sub profile of another profile.

I think we could check this by:

composer create-project drupal/drupal:8.4.2 /var/www/html/dev/drupal842 --stability dev --no-interaction -vvv
  cd /var/www/html/dev/drupal842/
  composer require drupal/simple_sitemap:2.x-dev

We could test this with the standard Drupal profile to add the module in the standard.info.yml to be enabled when we install, and after the install we can check the error loges
http://cgit.drupalcode.org/drupal/tree/core/profiles/standard/standard.i...

Rajab Natshah’s picture

Thank you Pawel,
I'm testing this, if the schema changed we may need to change as you listed.

Rajab Natshah’s picture

You are right Pawel,
After the full test for an enable within the install process:

  • Drupal 8.4.2 with "drupal/simple_sitemap": "2.x-dev"
  • Drupal 8.4.2 with "drupal/simple_sitemap": "2.10"

Both worked well and the push
simple sitemap Recent log messages dev drupal842

simple sitemap Details dev drupal842

Following with your comments

  • gbyte.co committed 4a159db on 8.x-2.x
    Issue #2913507 by RajabNatshah, Saphyel: Undefined index: include_images
    
gbyte’s picture

Status: Active » Fixed

This is not necessary, but adding empty check in case link array is altered with hooks. This should fix this issue as well.

chOP’s picture

Can anyone provide a workaround for when we're not able to Uninstall and Reinstall this module to fix the PHP Notice: Undefined index: include_images

I'm stuck in this awful situation where I cannot uninstall and reinstall the module, because it's a requirement of some other custom written module. We run schema updates with update.php during every release, so I have no idea why this array key is missing, but it is. The cron run logs fill up with the Notices.

Any help appreciated.

gbyte’s picture

@chOP Sure, just install the development version of the module and clear the cache by running update.php.

A hacky way to stay on the stable release, would be to temporarily remove the reference to this module from the other module's 'requirements' array from its .info file and then reinstalling this module.

kgeeraerts’s picture

Hi, I'm encountering thesame issue so I'm trying to upgrade to dev but when I try to run composer require drupal/simple_sitemap:8.x-2.x-dev, I keep getting:

" Package drupal/simple_sitemap at version 8.x-2.x-dev has a PHP requirement incompatible with your PHP version (7.1.8.0)"

gbyte’s picture

@KennyGeeraerts I am not sure why you are getting this, simple_sitemap does not declare a minimum version of PHP, it should always work with the PHP version required by Drupal core.

Please however open up a new issue as you don't want all subscribers to get email updates about stuff they didn't subscribe to.

kgeeraerts’s picture

mondays... I had to ommit the 8.x from the composer command - non-sensical error in any case but owh well...

Update works and the warning is gone, thanks gbyte.co !

Status: Fixed » Closed (fixed)

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