-
-
Notifications
You must be signed in to change notification settings - Fork 28
[#1979] Added support for xmlsitemap module for sitemap.xml generation.
#2264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment has been minimized.
This comment has been minimized.
|
|
|
f352a58 to
529de45
Compare
WalkthroughAdds the Drupal XML Sitemap module to the project: registers it with the installer, adds the Composer dependency, includes it in provisioning, supplies environment-specific settings, and adds Behat and PHPUnit tests verifying installation and configuration. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
This comment has been minimized.
This comment has been minimized.
|
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2264 +/- ##
==========================================
- Coverage 77.05% 76.44% -0.61%
==========================================
Files 114 107 -7
Lines 5988 5830 -158
Branches 44 0 -44
==========================================
- Hits 4614 4457 -157
+ Misses 1374 1373 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
529de45 to
0c23b80
Compare
|
This comment has been minimized.
This comment has been minimized.
|
|
0c23b80 to
a1aedb2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@web/sites/default/includes/modules/settings.xmlsitemap.php`:
- Around line 10-13: The conditional is accessing $settings['environment']
without a guard which can emit a PHP notice; update the if check to use a
null-coalescing or isset guard (e.g. ($settings['environment'] ?? NULL) or
isset($settings['environment']) ? $settings['environment'] : NULL) when
comparing to ENVIRONMENT_PROD, then keep the existing assignments to
$config['xmlsitemap.settings']['disable_cron_regeneration'] and
$config['xmlsitemap_engines.settings']['submit'] unchanged so the block only
runs when the environment value exists and is not ENVIRONMENT_PROD.
| // Disable submitting sitemap to search engines in non-production environments. | ||
| if ($settings['environment'] !== ENVIRONMENT_PROD) { | ||
| $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; | ||
| $config['xmlsitemap_engines.settings']['submit'] = FALSE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard against missing environment setting to avoid notices.
If $settings['environment'] isn’t defined when this include runs, PHP emits a notice. Use a null-coalescing guard.
Proposed fix
-if ($settings['environment'] !== ENVIRONMENT_PROD) {
+if (($settings['environment'] ?? null) !== ENVIRONMENT_PROD) {
$config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE;
$config['xmlsitemap_engines.settings']['submit'] = FALSE;
}🤖 Prompt for AI Agents
In `@web/sites/default/includes/modules/settings.xmlsitemap.php` around lines 10 -
13, The conditional is accessing $settings['environment'] without a guard which
can emit a PHP notice; update the if check to use a null-coalescing or isset
guard (e.g. ($settings['environment'] ?? NULL) or
isset($settings['environment']) ? $settings['environment'] : NULL) when
comparing to ENVIRONMENT_PROD, then keep the existing assignments to
$config['xmlsitemap.settings']['disable_cron_regeneration'] and
$config['xmlsitemap_engines.settings']['submit'] unchanged so the block only
runs when the environment value exists and is not ENVIRONMENT_PROD.
|
|
|
|
Closes #1979
Summary by CodeRabbit
New Features
Chores
Tests