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

ReferenceToken::fromString(): Argument #1 ($value) must be of type string, int given, called in vendor/ergebnis/json-normalizer/src/SchemaNormalizer.php on line 237 #867

Closed
alexis-saransig-lullabot opened this issue Mar 7, 2023 · 3 comments · Fixed by #868
Assignees
Labels

Comments

@alexis-saransig-lullabot
Copy link
Contributor

Steps required to reproduce the problem

  1. Run composer normalize --no-update-lock

This is an update required after upgrading Drupal Core to 9.5.

Expected Result

  • Successfully normalized ./composer.json.

Actual Result

 [TypeError]                                                                                                                                                                                               
  Ergebnis\Json\Pointer\ReferenceToken::fromString(): Argument #1 ($value) must be of type string, int given, called in /var/www/html/vendor/ergebnis/json-normalizer/src/SchemaNormalizer.php on line 237 

Exception trace:
  at /var/www/html/vendor/ergebnis/json-pointer/src/ReferenceToken.php:63
 Ergebnis\Json\Pointer\ReferenceToken::fromString() at /var/www/html/vendor/ergebnis/json-normalizer/src/SchemaNormalizer.php:237
 Ergebnis\Json\Normalizer\SchemaNormalizer->normalizeObject() at /var/www/html/vendor/ergebnis/json-normalizer/src/SchemaNormalizer.php:113
 Ergebnis\Json\Normalizer\SchemaNormalizer->normalizeData() at /var/www/html/vendor/ergebnis/json-normalizer/src/SchemaNormalizer.php:214
...
@localheinz
Copy link
Member

@alexis-saransig-lullabot

Do you have an example composer.json where you observed the issue?

@localheinz localheinz self-assigned this Mar 7, 2023
@localheinz localheinz added the bug label Mar 7, 2023
@alexis-saransig-lullabot
Copy link
Contributor Author

Hi @localheinz, here I leave the file so you can review it.
composer.json.zip
Thanks in advance.

@fredden
Copy link
Contributor

fredden commented Mar 9, 2023

From what I can tell, this composer.json is enough to reproduce the bug.

{
    "repositories": {
        "0": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    }
}

localheinz pushed a commit to alexis-saransig-lullabot/json-normalizer that referenced this issue May 2, 2023
localheinz added a commit that referenced this issue May 2, 2023
…ariable-type

Issue #867: Fixing variable type error by casting the value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants