Comments

Aston Victor created an issue. See original summary.

astonvictor’s picture

StatusFileSize
new20.65 KB

My patch:
1. Fixed all coding standards.
2. Used short array syntax [] instead of array().
3. Used $this->t() instead of t() in all classes.
4. Removed all unused classes.

astonvictor’s picture

Status: Active » Needs review
laravz’s picture

Status: Needs review » Needs work

Hi,

The patch was successfully applied to my project and most coding standard issues were resolved. Phpcs found the remaining errors (ignoring dependency injection):

FILE: ...var/www/natarch/modules/contrib/image_popup/image_popup.info.yml
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | WARNING | Remove "project" from the info file, it will be added
   |         | by drupal.org packaging automatically
 1 | WARNING | Remove "version" from the info file, it will be added
   |         | by drupal.org packaging automatically
----------------------------------------------------------------------


FILE: .../modules/contrib/image_popup/src/Form/EditorImagePopupDialog.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
----------------------------------------------------------------------
 55 | ERROR | Parameter $form is not described in comment
 55 | ERROR | Parameter $form_state is not described in comment
----------------------------------------------------------------------

FILE: ...pup/src/Plugin/Field/FieldFormatter/ImagePopupFieldFormatter.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
 179 | WARNING | Unused variable $key.
----------------------------------------------------------------------

Would it be possible for you to resolve these final errors and warnings?

swarad07’s picture

Version: 8.x-1.1 » 8.x-1.x-dev
Status: Needs work » Needs review
StatusFileSize
new18.93 KB

Closed the duplicae #2758991: Fix coding standard issues. in favour of this issue. Adding updated patch here, the patch in #2 did not apply cleanly for me against 8.x-1.x.

I have intentionally not corrected,

----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
----------------------------------------------------------------------
 55 | ERROR | Parameter $form is not described in comment
 55 | ERROR | Parameter $form_state is not described in comment
----------------------------------------------------------------------

They seem to be valid changes.

laravz’s picture

Status: Needs review » Needs work

This patch applies cleanly to the 8.x-1.x branch but not to the 8.x-1.x-dev branch. Do you happen to have other patches applied on that branch? When applied to the 8.x-1.x branch all errors (except the ones mentioned) are fixed for standard=Drupal. However, unlike the previous patch, some errors remain when using standard=DrupalPractice. That is, several t() functions have not been replaced with $this->t().

swarad07’s picture

StatusFileSize
new19.88 KB

Hi,

I did not realize that there is a separate dev branch. I am not able to see it, are you sure you are checking it on " 8.x-1.x-dev" branch?

I updated my patch to include DrupalPractice fixes as well, few are pending will look into this tomorrow.

laravz’s picture

It's called the 8.x-dev branch in git (8.x-1.x-dev is the version number in the metadata of this issue). I'll review it again tomorrow.

laravz’s picture

Status: Needs work » Reviewed & tested by the community

The new patch fixes all issues with the exception of dependency injection (fixed in this issue) and the two form parameters (as discussed).

swarad07’s picture

Great! this looks good to be committed.

rakesh.gectcr’s picture

Assigned: Unassigned » rakesh.gectcr
Status: Reviewed & tested by the community » Needs work

The patch is not applying

git apply -v 2933504-phpcs-fixes-17.patch
Checking patch image_popup.module...
Checking patch src/Controller/ImagePopup.php...
Checking patch src/Form/EditorImagePopupDialog.php...
Checking patch src/Plugin/CKEditorPlugin/ImagePopup.php...
Checking patch src/Plugin/Field/FieldFormatter/ImagePopupFieldFormatter.php...
error: while searching for:
      }
      global $base_url;
      $img = "<img src='" . $absolute_path . "'><img>";
      $img_link = "<a href='" . $base_url . "/image_popup/render/" . $image_fid. "/" .  $image_style_popup. "' class='use-ajax' data-dialog-type='modal' data-dialog-options='{\"width\":". $popup_width ."}'>" . $img . "</a>";
      $elements[$delta] = array(
        '#markup' => $img_link,
      );

    }


error: patch failed: src/Plugin/Field/FieldFormatter/ImagePopupFieldFormatter.php:200
error: src/Plugin/Field/FieldFormatter/ImagePopupFieldFormatter.php: patch does not apply
rakesh.gectcr’s picture

Issue tags: +Drupal 9 porting weekend, +Drupal 9 compatibilityDrupal 9 porting weekendDIACWMay2020
kristen pol’s picture

Issue tags: -Drupal 9 compatibilityDrupal 9 porting weekendDIACWMay2020 +Drupal 9 compatibility, +DIACWMay2020

Fixing tags.

anisha.challa’s picture

StatusFileSize
new22.14 KB

Hi,
Applied patch, please review.

jaykandari’s picture

Version: 8.x-1.x-dev » 2.x-dev
Assigned: rakesh.gectcr » Unassigned
jaykandari’s picture

Status: Needs work » Fixed

Coding standards are already fixed in https://www.drupal.org/project/image_popup/issues/2933506 ticket. Thus marking this as Fixed.

Thank you all for the contributions.

Status: Fixed » Closed (fixed)

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