Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter roelhugens

    (@roelhugens)

    Some extra info about where the issue is:
    posts-to-posts/vendor/mustache/mustache/src/Mustache/Engine.php in the function getTemplateClassName.
    There is entity_flags:%i set as integer (%i) but this format specifier is unknown for the sprintf function. So I changed this to %u (unsigned integer representation of a positive integer)

    Thread Starter roelhugens

    (@roelhugens)

    Hi Stiofan,

    We used this plugin before and had no issues.
    For a new project we upgraded PHP from 7.4 to 8 and this issue popped up.

    When we want to make the connection between two custom posttypes like in the code below, the error shows us that the “i” format specifier is unknown.

    p2p_register_connection_type([
                    'name' => "posttype1_to_posttype2",
                    'from' => 'posttype1',
                    'to' => 'posttype2',
                    'cardinality' => 'many-to-many',
                    'reciprocal' => true,
                    'sortable' => 'any',
                    'admin_column' => 'any',
                    'admin_dropdown' => 'any',
                    'can_create_post' => false,
                    'admin_box' => [
                        'show' => 'any',
                        'context' => 'advanced',
                    ],
                ]);

    This issue is triggered in the mustache plugin that is used by p2p
    Let me know if you need more info, I can make it work by changing the identifier in the plugin. But I’m not 100% sure if it is the right solution.

    Thanks in advance,

    Roel

    • This reply was modified 3 years, 3 months ago by roelhugens.
    • This reply was modified 3 years, 3 months ago by roelhugens.
    Thread Starter roelhugens

    (@roelhugens)

    The above “solution” is of course not what it fixes, since it needs to be an integer value. I’m not sure what the exact specifier it should be (see https://www.php.net/manual/en/function.sprintf.php).

    My guess it needs to be “u”? Hope you can give an update

Viewing 3 replies - 1 through 3 (of 3 total)