alex4401 / mediawiki-extensions-DataMaps

Interactive data maps extension without extra services needed.
https://mediawiki.org/wiki/Extension:DataMaps
Other
5 stars 4 forks source link

Trying to access array offset on value of type int #299

Closed alistair3149 closed 14 hours ago

alistair3149 commented 1 month ago

Got the following error on MediaWiki 1.43 with PHP 8.1.20 (fpm-fcgi)

Warning: Trying to access array offset on value of type int in /var/www/html/w/extensions/DataMaps/includes/Data/CoordinateSystem.php on line 27
alex4401 commented 1 month ago

Do you have more of the stack trace?

alistair3149 commented 1 month ago

Nothing in the log. This is repeated 4 times so it probably has something to do with the tiles:

{
    "$schema": "http://localhost:8080/w/extensions/DataMaps/schemas/v17.2.json",
    "crs": {
        "topLeft": [ 0, 0 ],
        "bottomRight": [ 512, 512 ],
        "order": "xy"
    },
    "background": {
        "at": [ 0, 0 ],
        "tileSize": [ 256, 256 ],
        "tiles": [
            {
                "position": [ 0, 0 ],
                "image": "RGB 24bits palette R170.png"
            },
            {
                "position": [ 0, 1 ],
                "image": "BlueSqq2.png"
            },
            {
                "position": [ 1, 0 ],
                "image": "BlueSqq3.png"
            },
            {
                "position": [ 1, 1 ],
                "image": "Map railroad japan hitahikosan rough.png"
            }
        ]
    },
    "settings": { "requireCustomMarkerIDs": true },
    "groups": {
        "example": {
            "name": "Example group",
            "pinColor": "#f00"
        }
    },
    "markers": {
        "example": [
            {
                "x": 50, "y": 50,
                "name": "Example marker"
            }
        ]
    }
}
alex4401 commented 1 week ago

Seems to be coming from at field generation. Tiles now don't use it so it could be omitted safely, but first I have to run a scan on wiki.gg to see how many maps will be impacted by the tile changes.

alex4401 commented 14 hours ago

Disallowed at in tiled backgrounds with bb16dd95901a9ab8e69c7d10eb277b54b03899a5.