TypeError in using Textoverlay

Created on 17 December 2024, 5 days ago

Problem/Motivation

By using TextOverlay, I'm having this error:

TypeError - Drupal\image_effects\Plugin\ImageToolkit\Operation\gd\TextOverlay::imagettftextWrapper(): Argument #4 ($x) must be of type int, float given, called in C:\xampp\htdocs\site11\web\modules\contrib\image_effects\src\Plugin\ImageToolkit\Operation\gd\TextOverlay.php on line 83.

Drupal 10.3.10, PHP 8.3 and Image_effects 4.0.

Problem is probably the more strict usage of types in php 8.3.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇧🇪Belgium ericvl

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

Merge Requests

Comments & Activities

  • Issue created by @ericvl
  • First commit to issue fork.
  • Pipeline finished with Failed
    4 days ago
    Total: 209s
    #371955
  • I have created the patch please review it .

  • 🇧🇪Belgium ericvl

    Why is the patch different from the diff of the merge request?
    The patch covers 2 issues while the MR covers just one.
    The MR works for me for the issue that is specified in the title but maybe there is a second issue in the file that is covered by the patch too that I can't test.

  • 🇮🇹Italy mondrake 🇮🇹

    Thanks all!

    Please do not post patch files: this project only accepts MRs.

    Automated tests are failing, so this issue needs work to solve the failures.

  • 🇮🇳India priti197

    @ericvl, there is no need of typecasting at line 69 & 70 as per patch #4. Variables $c1, $c2 are simply defined for iteration of the for() loop.
    @mondrake, MR !64 is created to fix the addressed issue.
    Thank you.

  • 🇧🇪Belgium ericvl

    @priti Then it is OK for me, thanks

  • 🇮🇹Italy mondrake 🇮🇹

    Tests are failing.

  • 🇧🇪Belgium ericvl

    I tested the issue just by manually adding the two (int) casts in the file and checked of the issue still existed. And the test did well. What I don't understand is how the junit tests could fail after the patch in the MR was applied?
    If this test fails now it should have been failed at release of the 4.0.0 version.
    Strange...
    Anyway, the two casts are the solution to this issue.

Production build 0.71.5 2024