In \Drupal\instagram_without_api\Plugin\BlockInstagramWithoutApi::build() this module return FALSE if any exception occurs. This is incorrect as the interface defines that an array has to be returned.

Returning the wrong type my throw exceptions elsewhere in PHP 7.2 and later, if other modules rely on the type declarations in interfaces.

Comments

jurgenhaas created an issue. See original summary.

jurgenhaas’s picture

Status: Active » Needs review
StatusFileSize
new2.44 KB
ngkoutsaik’s picture

Status: Needs review » Reviewed & tested by the community

Hi,

thanks for the patch. I tested it on my local machine and it works as intended.

auxiliaryjoel’s picture

@jurgenhaas when I try and apply this patch via ssh to my cpanel hosted site I get this error:
can't find file to patch at input line 5

I'm currently running CLI from the directory: instagram_without_api
which is situated here:/web/modules/contrib/instagram_without_api

this is the patch I'm trying to apply:
https://www.drupal.org/files/issues/2020-01-12/3105915-2.instagram_witho...

what am I doing wrong?

jurgenhaas’s picture

@auxiliaryjoel is your Drupal project based on Composer? If not, you may consider switching over. If it was, you can use the composer patches plugin and the patch will be applied each and every time you update your project automatically. You can find that plugin her: https://github.com/cweagans/composer-patches - also the documentation for it.

If you're not yet on Composer, your best source for applying patches is this page: https://www.drupal.org/patch/apply

nwom’s picture

Version: 8.x-1.0 » 8.x-2.0

Also applies perfectly on the 2.0 branch.

ipwa’s picture

Version: 8.x-2.0 » 8.x-2.x-dev

Targeting correct branch now that branches have been fixed.

ipwa’s picture

  • ipwa committed 33252a0 on 8.x-2.x authored by jurgenhaas
    Issue #3105915 by jurgenhaas, ipwa: InstagramWithoutApi::build() needs...
ipwa’s picture

Patch did not apply cleanly anymore but it was just a one line change.

Thanks for your contribution @jurgenhaas :)

ipwa’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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