If multiple-plan mode is enabled in the settings, active plans have a Change plan link on the Subscription page, /user/USER_ID/subscription.

Clicking on the link yields:

PHP message: PHP Fatal error: Call to a member function getEntityType() on a non-object in /path/to/drupal/modules/contrib/recurly/src/Access/RecurlyAccessUser.php on line 17

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

colan created an issue. See original summary.

colan’s picture

Title: Cannot change plans » Cannot change plans in multiple-plan mode
Status: Active » Needs work
FileSize
2.65 KB

Looks like this is only an issue in multiple-plan mode so I'm updating the title. I started doing some work on this, but I'm stopping now.

With the patch, the error goes away, but we're now getting a 403. The problem is that the Change plan link in multiple plan mode has the wrong target. It should be the same target as Change plan in single-plan mode.

markdorison’s picture

Patch needs re-roll. Is this issue still occurring?

colan’s picture

The patch fixed one problem, but not a second one that popped up.

I no longer need this to be fixed (at least not now) so won't be working on it for the time being.

markdorison’s picture

Re-rolled patch in #2.

markdorison’s picture

There seem to be a few things going on here and as I began to pull the thread, my patch grew, before I ended up pulling it back. One structural change that I did end up with is that I removed the functionality that rendered change/cancel as tabs when in single subscription configuration and as links in multi-subscription configuration. Now they are always rendered as links along with the subscription listing itself.

This is a work in progress. It also contains the following fixes that are being handled by other issues, but are needed here to not block us:

Remaining steps:

  • Get the change plan flow working. The url being rendered for the change plan link is sometimes not accurate. If you manually visit the change url's you can get the plan to change so the functionality is working.
  • Clean up any no longer needed code due to functionality changes.
markdorison’s picture

markdorison’s picture

Status: Needs work » Needs review
FileSize
6.08 KB
1.69 KB

Assuming the patch works as expected, the remaining tasks would be to verify that there is no orphaned code that could now be removed with these changes. I am specifically thinking about the access class and it's service that may no longer be needed.

walangitan’s picture

@markdorison - Including one of the access changes from #2 that @colan included that seemed to slip through the cracks in the re-roll. Also removed the access class completely -- in testing it appears that it's not utilized any longer though another review/reviewer would be prudent.

markdorison’s picture

Fixed two small PHPCS issues.

markdorison’s picture

Status: Needs review » Needs work

Patch needs re-roll.

walangitan’s picture

Status: Needs work » Needs review
FileSize
7.1 KB

Re-rolled #10. Didn't include the interdiff since the one line in RecurlyAccessUser.php was already been committed in #2749513: Show available plans to anonymous users.

  • markdorison committed 3c881bf on 8.x-1.x authored by walangitan
    Issue #2760927 by markdorison, walangitan, colan: Cannot change plans in...
markdorison’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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