View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0007615 | OXID eShop B2B Edition | B2B edition - sub | public | 2024-03-08 15:36 | 2024-07-03 15:27 |
| Reporter | mario_lorenz | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | confirmed | Resolution | open | ||
| Product Version | 6.0.0 | ||||
| Target Version | 6.0.1 | ||||
| Summary | 0007615: maintenance-mode because Call to a member function getId() on bool | ||||
| Description | Bug 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 Reproduce | When 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 Information | Solution: 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()". | ||||
| Tags | No tags attached. | ||||