Replaced deprecated functions like REQUEST_TIME, db_update.

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:

Comments

Munavijayalakshmi created an issue. See original summary.

Munavijayalakshmi’s picture

Assigned: Munavijayalakshmi » Unassigned
Status: Active » Needs review
StatusFileSize
new1.73 KB
vaibhavjain’s picture

Status: Needs review » Needs work
+++ b/src/Controller/GISController.php
@@ -133,8 +133,8 @@ class GISController extends ControllerBase {
+          \Drupal::database()->update('google_image_sitemap')

Can you use the Inject DB object for any Database related stuff in this class.

saphemmy’s picture

Assigned: Unassigned » saphemmy

Will work on this.

saphemmy’s picture

Assigned: saphemmy » Unassigned
Status: Needs work » Needs review
tmaiochi’s picture

Assigned: Unassigned » tmaiochi

I'll review this!

tmaiochi’s picture

Assigned: tmaiochi » Unassigned
Status: Needs review » Reviewed & tested by the community

Steps performed:
(1) Installed module
(2) Reproduced the issue.
(3) Applied patch.
(4) Code review on changes.
(5) Tested again with patch, issue resolved.
The commit removed all deprecated code in this module, and the module still working well as far as I can test it.

vaibhavjain’s picture

Status: Reviewed & tested by the community » Needs work

Hi,

Please see if you can improve the patch.

  1. +++ b/src/Controller/GISController.php
    @@ -133,8 +133,8 @@ class GISController extends ControllerBase {
    +          \Drupal::database()->update('google_image_sitemap')
    

    Can you please try to use Dependency Injection for DB.

  2. +++ b/src/Form/GoogleImageSitemapCreateForm.php
    @@ -70,11 +70,11 @@ class GoogleImageSitemapCreateForm extends FormBase {
    +      $sitemap['created'] = \Drupal::time()->getRequestTime();
    

    Same here.

  3. +++ b/src/Form/GoogleImageSitemapCreateForm.php
    @@ -70,11 +70,11 @@ class GoogleImageSitemapCreateForm extends FormBase {
    +    $sitemap['last_updated'] = \Drupal::time()->getRequestTime();
    

    Same here.

saphemmy’s picture

Assigned: Unassigned » saphemmy
saphemmy’s picture

Status: Needs work » Needs review
StatusFileSize
new1.91 KB

1.) This is already fixed in the latest version:

+++ b/src/Controller/GISController.php
@@ -133,8 +133,8 @@ class GISController extends ControllerBase {
+          \Drupal::database()->update('google_image_sitemap')

2.) Here is the patch for the dependency injection fix for points 2&3

tmaiochi’s picture

Assigned: saphemmy » tmaiochi

I'll review this!

tmaiochi’s picture

Assigned: tmaiochi » Unassigned
Status: Needs review » Reviewed & tested by the community

I've just added the patch in MR, by the way the patch added dependency injection correctly. How was said in #11 This is already fixed in the latest version:

+++ b/src/Controller/GISController.php
@@ -133,8 +133,8 @@ class GISController extends ControllerBase {
+          \Drupal::database()->update('google_image_sitemap')

Moving it to RTBC!

vaibhavjain’s picture

Thanks for the PR, it has been merged.

vaibhavjain’s picture

Status: Reviewed & tested by the community » Fixed

  • vaibhavjain committed 15a50aa on 2.0.x authored by saphemmy
    Issue #2875101 by saphemmy, tmaiochi, Munavijayalakshmi: Replaced...

Status: Fixed » Closed (fixed)

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