• Resolved josesqdro

    (@josesqdro)


    Hello,

    I encountered a fatal error in your plugin (ACF Views / Advanced Views) caused by this line in:

    src/Post_Selections/Query/Query_Utils.php

    return is_callable( $value ) ? $value() : $value;
    

    Problem

    When $value is a string like 'date', PHP considers it callable:

    is_callable('date') === true
    

    So the plugin executes:

    date()
    

    without arguments, which triggers:

    PHP Fatal error: date() expects at least 1 argument, 0 given
    

    Fix

    A safer approach is to only execute real closures:

    return ($value instanceof \Closure) ? $value() : $value;
    

    Why this matters

    This prevents unintended execution of native PHP functions (date, time, etc.) when they are used as string values in query arguments (e.g. orderby => 'date').

    Let me know if you need more details.

    Thanks for your work 👍

    José.

Viewing 1 replies (of 1 total)
  • Plugin Support Baxter Jones

    (@baxterjones)

    Thanks for reporting this, @josesqdro

    You’re absolutely right about the cause — this is related to the sorting issue, and it has been resolved in the latest release.

    I’ll close this ticket, but if you’re having any related issues then feel free to reply here.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.