After syncing plans, the plan is not editable on the subscription plans screen. I receive same error on both rc2 and latest dev 1.x
/admin/structure/stripe-registration/stripe-plan/1/edit

InvalidArgumentException: Field user_id is unknown. Drupal\Core\Entity\ContentEntityBase->getTranslatedField (line 580 core/lib/Drupal/Core/Entity/ContentEntityBase.php)

Comments

brandonratz created an issue. See original summary.

liliplanet’s picture

Solved:

Created API test keys
Created plans on Stripe
Synchronise, all good :)
On Stripe list, see Stripe plan ID and Name
On ‘edit’ to assign a role, get:

InvalidArgumentException: Field user_id is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 587 of /home/my/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php).

Update: this happens if you have the language module enabled. All good :)

ptmkenny’s picture

Status: Active » Closed (cannot reproduce)

Marking as closed because the issue was apparently fixed according to #2.

joe huggans’s picture

I don't think this can be classed as fixed, it is happening for me using version 3.x of this module and without the language module installed.

ptmkenny’s picture

Status: Closed (cannot reproduce) » Active
grasmash’s picture

Ok interesting. I'm not able to reproduce this. Could you provide a backtrace?

grasmash’s picture

Do you have the entity reference module enabled?

joe huggans’s picture

Sure, will get a backtrace soon. There is no entity reference module installed, apart from the Entity Reference Revisions module, not sure if that is relevant.

grasmash’s picture

Just to add some quick thoughts. I'd guess this is coming from the StripePlanEntity class, which uses methods like getOwner() to load the user_id property of a plan. Drupal core provides the user_id, so it's not actually defined in StripePlanEntity.

I can't seem to find where user_id actually gets defined, but I do see that various Drupal core tests assert it's presence.

joe huggans’s picture

I'll be testing this again this weekend so will provide more information then, so if we can leave this open in the meantime. Thanks

joe huggans’s picture

Got it round to doing this earlier than expected, here is the stack trace

InvalidArgumentException: Field user_id is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 587 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).

Drupal\Core\Entity\ContentEntityBase->get('user_id') (Line: 112)
Drupal\stripe_registration\Entity\StripePlanEntity->getOwnerId() (Line: 69)
Drupal\commerce_license\FormAlter\GrantedEntityFormAlter->formAlter(Array, Object, 'stripe_plan_edit_form') (Line: 88)
commerce_license_form_alter(Array, Object, 'stripe_plan_edit_form') (Line: 539)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'stripe_plan_edit_form') (Line: 838)
Drupal\Core\Form\FormBuilder->prepareForm('stripe_plan_edit_form', Array, Object) (Line: 279)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 91)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

  • grasmash committed db88efe on 3.x
    Issue #2974144: Unable to edit subscription plans (Field user_id is...
grasmash’s picture

Status: Active » Needs review

I've pushed a change up that should resolve this. Please test and verify.

joe huggans’s picture

Seems good to me!

grasmash’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.