Skip to content

Type error on lattitude/longitude in BE #614

@RaphaelRochet

Description

@RaphaelRochet

Bug Report

Current Behavior
If I ever add coordinates to a tt_address record, I get this error in backend when trying to edit my tt_address record :

FriendsOfTYPO3\TtAddress\Utility\EvalcoordinatesUtility::formatLatitude(): Argument #1 ($coordinate) must be of type string, float given, called in /var/www/html/typo3conf/ext/tt_address/Classes/Evaluation/LatitudeEvaluation.php on line 47

( Happens wether I use map wizard or not )

Expected behavior/output
I should be able to edit a record with coordinates in it.

Environment

  • TYPO3 version(s): 13.4.18, 13.4.22, 14.0.1
  • tt_address version: 10.0.0
  • Is your TYPO3 installation set up with Composer (Composer Mode): no
  • OS: docker container based on official image php:8.4-apache
  • SQLite database

Possible Solution
What I did to make it work :
in /Utility/EvalcoordinatesUtility.php, I remove the "string" type from functions formatLongitude and formatLatitude, and used strval($coordinate) when they call validate
diff_1.txt

Also had to change /FormEngine/FieldControl/LocationMapWizard.php to use strval around $row['latitude'] and $row['longitude'], because htmlspecialchars() expects a string and both were float typed.
diff_2.txt

Additional context
This is a new, almost empty typo3 project. tt_address in the only extension installed.
I use French locale (we oddly use a coma instead of a dot in decimal notation, maybe there's something about that)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions