[1.0.x] Picture Everywhere

Created on 13 March 2023, about 2 years ago

Picture Everywhere → overrides image templates and provides preprocessing to standardize use of the HTML <picture> tag, as opposed to standalone <img> tags. It steps into preprocessing late in the process, so that code and developers who assume/are used to having just an <img> tag still have standard markup to work with. Attributes are parceled out to either the <picture> or <img> tag using a configurable + partially hardcoded list of attributes that should go on the <img> tag, with everything left over going to the <picture>.

It also has some optional integrations with other modules such as WebP → (automatic webp source for non-responsive images) and SVG Image Field → (also wrapping those <img> tags as well).

📌 Task
Status

Needs review

Component

module

Created by

🇺🇸United States bvoynick

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @bvoynick
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇳India vishal.kadam Mumbai

    Fix PHPCS issues. You can use the PHPCS tool for checking and resolving issues.

    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml picture_everywhere/
    
    FILE: picture_everywhere/picture_everywhere.module
    --------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    --------------------------------------------------------------------------------
     32 | ERROR | The array declaration extends to column 98 (the limit is 80). The array content should be split up over multiple lines
     46 | ERROR | The array declaration extends to column 113 (the limit is 80). The array content should be split up over multiple lines
     56 | ERROR | The array declaration extends to column 82 (the limit is 80). The array content should be split up over multiple lines
    --------------------------------------------------------------------------------
    
    
    FILE: picture_everywhere/src/Form/SettingsForm.php
    --------------------------------------------------------------------------------
    FOUND 4 ERRORS AFFECTING 4 LINES
    --------------------------------------------------------------------------------
      29 | ERROR | Missing @var tag in member variable comment
      34 | ERROR | Missing @var tag in member variable comment
     158 | ERROR | The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
     232 | ERROR | The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
    --------------------------------------------------------------------------------
    
    
    FILE: picture_everywhere/src/Preprocess.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    --------------------------------------------------------------------------------
      96 | WARNING | [ ] Line exceeds 80 characters; contains 85 characters
     119 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
  • Status changed to Needs work about 2 years ago
  • Status changed to Needs review about 2 years ago
  • 🇺🇸United States bvoynick

    Changes are committed to the 1.0.x branch.

    1. Lines over 80: Okay, I've disabled the custom line limits in the module's phpcs.xml.dist, and linted for the resulting column 80 issues.

    I'm not seeing the other errors shown in #3. Make sure you're using the latest drupal/coder, version 8.3.17 or newer. For instance, #3123282 → recently changed docblock standards so that an @var tag is not required if the property already has a type declaration in PHP itself.

    2. Commented properties: okay, removed.

    PHP requirement: the module supports Drupal 9.4.x or later. (This can be checked in the core_version_requirement property.) Drupal 9.x itself only outright requires PHP 7.3, though I think the messaging lately is that at least 8.0 is "strong recommended" for 9's latest minor versions. If and when the module drops Drupal 9 support the PHP version requirement could indeed be increased, or possibly removed.

  • 🇮🇳India vishal.kadam Mumbai

    @bvoynick,

    I have reviewed the changes, and they look fine to me.

    Let’s wait for other reviewers to take a look and if everything goes fine, you will get the role.

    Thanks

  • Status changed to RTBC about 2 years ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
        foreach ($allowed_img_tags as $allowed_img_tag) {
          if (!preg_match('/^[^\t\n\f \/<>"\'=]+$/', $allowed_img_tag)) {
            $form_state->setErrorByName('output][img_tag_attributes', '"' . $allowed_img_tag . '" is not a valid HTML attribute.');
          }
        }
    

    The second parameter passed to setErrorByName() needs to be a translatable string.

  • Status changed to Fixed about 2 years ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    Thank you for your contribution! I am going to update your account.

    These are some recommended readings to help with excellent maintainership:

    You can find more contributors chatting on the Slack → #contribute channel. So, come hang out and stay involved → .
    Thank you, also, for your patience with the review process.
    Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review → . I encourage you to learn more about that process and join the group of reviewers.

    I thank all the reviewers.

  • 🇺🇸United States bvoynick

    Thanks folks!

    And thanks for pointing out that untranslated string.

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

  • Assigned to apaderno
  • Status changed to Fixed 20 days ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
Production build 0.71.5 2024