Problem/Motivation

If the user try to hit the acceptance URL with a wrong invitation code, the user will see the following PHP error:

Error: Call to a member function getOwnerId() on bool in Drupal\invite\Controller\InviteAccept->accept() (Zeile 71 in /var/www/DudenDe/web/modules/contrib/invite/src/Controller/InviteAccept.php)
#0 [internal function]: Drupal\invite\Controller\InviteAccept->accept()

So no invitation can be found related to this code, this can happen for many reason.

Steps to reproduce

Try to open the accepetence URL with a not valid code.
/invite/accept/xyzxyz

Proposed resolution

adding an IF statement to check of the invitation entity is loaded and exists before calling its methods and adding an error message to tell the user the code is invalid.

Issue fork invite-3328211

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

abdhomsi created an issue. See original summary.

abdhomsi’s picture

Status: Active » Needs review