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

Error while fetching an empty phone field value with GQL #111

Open
codename-niels opened this issue Aug 15, 2023 · 0 comments
Open

Error while fetching an empty phone field value with GQL #111

codename-niels opened this issue Aug 15, 2023 · 0 comments

Comments

@codename-niels
Copy link

codename-niels commented Aug 15, 2023

An error occurred while I added a Linkit field with the phone number type selected and left the field empty.

Craft: 4.4.17
Linkit: 4.0.4.1

To reproduce, add a linkit field and enable the phone type. Set the field in an entry to phone and leave the value empty. Save the entry and fetch the value via GQL.

Error:

{
      "debugMessage": "craft\\helpers\\StringHelper::stripWhitespace(): Argument #1 ($str) must be of type string, null given, called in /app/vendor/presseddigital/linkit/src/models/Phone.php on line 35",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "file": "/app/vendor/craftcms/cms/src/helpers/StringHelper.php",
      "line": 1455,
      "trace": [
        {
          "file": "/app/vendor/presseddigital/linkit/src/models/Phone.php",
          "line": 35,
          "call": "craft\\helpers\\StringHelper::stripWhitespace(null)"
        },
        {
          "file": "/app/vendor/yiisoft/yii2/base/Component.php",
          "line": 231,
          "call": "presseddigital\\linkit\\models\\Phone::getUrl()"
        },
        {
          "file": "/app/vendor/yiisoft/yii2/base/Model.php",
          "line": 1021,
          "call": "yii\\base\\Component::__isset('url')"
        },
        {
          "file": "/app/vendor/webonyx/graphql-php/src/Executor/Executor.php",
          "line": 177,
          "call": "yii\\base\\Model::offsetExists('url')"
        },
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