Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in the backend if I broke up an action #2558

Open
birdsinthesun opened this issue Jan 5, 2025 · 2 comments
Open

Bug in the backend if I broke up an action #2558

birdsinthesun opened this issue Jan 5, 2025 · 2 comments

Comments

@birdsinthesun
Copy link

Hi, I found some Issue and have a fix for that:

`// Generate groups
do {
$objGroup = Group::findByPk($intPid);

        if (null !== $objGroup && $objGroup->id && $objGroup->name) {
            $arrGroups[] = array('id' => $objGroup->id, 'name' => $objGroup->name);

            if ($objGroup->pid) {
                // Do not show the mounted groups
                if (!$objUser->isAdmin && $objUser->hasAccess($objGroup->id, 'iso_groups')) {
                    break;
                }

                $intPid = $objGroup->pid;
            }
        } else {
            // Kein gültiger Eintrag gefunden
            break;
        }
    } while ($objGroup->pid);`
@birdsinthesun birdsinthesun changed the title Bug im Backend if I broke up an action Bug in the backend if I broke up an action Jan 5, 2025
@birdsinthesun
Copy link
Author

Sorry, detailed Description is missing at this issue. I created a new productgroup, put a product in it and deleted the productgroup. Then I get a Error which referenced the line. The Error comes because there was no questiion about the $objGroup is null. So I fixed it.

@aschempp
Copy link
Member

aschempp commented Jan 8, 2025

Shouldn't we un-assign all products from a group if the group is deleted? Then the error wouldn't happen in the first place?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants