backdrop-contrib / views_json

A Views handler that returns data as JSON objects.
https://backdropcms.org/project/views_json
GNU General Public License v2.0
1 stars 1 forks source link

PHP compatibility check causes false result with 8.x #15

Closed indigoxela closed 1 year ago

indigoxela commented 1 year ago

Here's the code: https://github.com/backdrop-contrib/views_json/blob/1.x-1.x/views_json.module#L525

So, with php 8.0 or 8.1 the major version is bigger than 5 AND the minor version is smaller than 3.

This leads to wrong version assumption with 8.x. (Probably also with 7.1 or 7.2)

This popped up in an otherwise unrelated issue in another module https://github.com/backdrop-contrib/resource_timeslots/issues/23

Time to update this ancient code, which currently breaks the "Numeric strings" setting. :smirk:

indigoxela commented 1 year ago

I think, we can just drop these workarounds for php 5.2 and 5.4. Backdrop requires at least 5.6 - and that version properly handles json_encode().

indigoxela commented 1 year ago

FTR: @olafgrabienski successfully tested this PR (confirmed in the chat).

olafgrabienski commented 1 year ago

FTR: @olafgrabienski successfully tested this PR (confirmed in the chat).

Yep, I've tested it repeating the steps of the related Resources Timeslots issue report, and the PR fixed the issue for me.