Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apa.xsl, en-US, edition: '2nd', PHP Notice: A non well formed numeric value encountered in Rendering\Number.php on line 155 #159

Open
3 tasks done
glorieux-f opened this issue Aug 1, 2023 · 0 comments

Comments

@glorieux-f
Copy link
Contributor

glorieux-f commented Aug 1, 2023

Please follow the general troubleshooting steps first:

  • I read the README and followed the instructions.
  • I am sure that the used CSL metadata follows the CSL schema.
  • I use a valid CSL stylesheet

Bug reports:

PHP Notice: A non well formed numeric value encountered in Rendering\Number.php on line 155

citeproc-php

  • Doe, J. (n.d.). Edition not ordinal (2ndnd ed.).

Zotero dsektop

  • Doe, J. (n.d.). Edition not a simple number (2nd ed.).

«“2nd” tests “true”» Constraint/IsNumeric.php#L45

quick fix Rendering\Number.php#L152

public static function ordinal($num): string
{
    if (!is_numeric($num)) {
        return $num;
    }

Used CSL stylesheet:

apa.csl#L1040

  <if is-numeric="edition">
    <group delimiter=" ">
      <number variable="edition" form="ordinal"/>
      <label variable="edition" form="short"/>
    </group>
  </if>

Used CSL metadata

[
    {
        "id": "http://zotero.org/groups/5048422/items/Y5YV4MKH",
        "type": "book",
        "edition": "2nd",
        "title": "Edition not a simple number",
        "author": [
            {
                "family": "Doe",
                "given": "John"
            }
        ]
    }

]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant