View Issue Details

IDProjectCategoryView StatusLast Update
0007615OXID eShop B2B EditionB2B edition - subpublic2024-07-03 15:27
Reportermario_lorenz Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status confirmedResolutionopen 
Product Version6.0.0 
Target Version6.0.1 
Summary0007615: maintenance-mode because Call to a member function getId() on bool
DescriptionBug was noticed in version 7.0.0. But it already exists in 6.0.0. That's why I tagged it to 6.0.0.

Open

b2b-quick-orders-module/Controller/DetailsController.php

Search for "$this->getUser()->getId()". You will find it three times.

PHPStorms warn that a Null-Pointer-Exception is possible. And in the reproduction-case the Null-Pointer-Exception would be triggered (maintenance-mode).

Steps To ReproduceWhen you lose in the frontend the session and reload the details-page, then the details-page runs in a maintenance-mode because Call to a member function getId() on bool.

1. Use and activate OXID B2B modules
2. Make a user to a B2B user
3. Go to frontend
4. Login
5. Click on the profile symbol in the upper right corner
6. Click "My order lists"
7. Click "Add order lists", add a product and a quantity and click "Update"
8. Add a name for the list and click "Update and save the list"
9. Repeat step 5 + 6
10. Click on the "Eye"-symbol to open the details-page of your list
11. Copy the link of the addressbar and open a new anonymous browser
12. Paste the link. You will see the maintanance mode site. After a few seconds you will be redirected to the homepage
Additional InformationSolution:

Create a small method:

    protected function getUserId(): string
    {
        return $this->getUser() ? $this->getUser()->getId() : '';
    }

And use on the three places "$this->getUserId()" instead of "$this->getUser()->getId()".
TagsNo tags attached.

Activities

QA

2024-03-11 14:30

administrator   ~0016391

I get just redirected to the front-page if i delete session information stored in cookies.

Please provide more information to reproduce this issue.

QA -SG-