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

Joomla\CMS\Installer\InstallerScript::getInstances Unknown column 'id' in 'field list' #42191

Closed
svanschu opened this issue Oct 21, 2023 · 3 comments

Comments

@svanschu
Copy link
Contributor

In this method it tries to load the field 'id' from the extensions table. But there isn't any field called id in this table.

The id field for the extenions table is called extension_id

        // Select the item(s) and retrieve the id
        $query->select($db->quoteName('id'));

        if ($isModule) {
            $query->from($db->quoteName('#__modules'))
                ->where($db->quoteName('module') . ' = :extension');
        } else {
            $query->from($db->quoteName('#__extensions'))
                ->where($db->quoteName('element') . ' = :extension');
        }

It would need to look like

        // Select the item(s) and retrieve the id
       
        if ($isModule) {
            $query->select($db->quoteName('id'))
                  ->from($db->quoteName('#__modules'))
                ->where($db->quoteName('module') . ' = :extension');
        } else {
            $query->select($db->quoteName('extension_id') . ' as id')
                ->from($db->quoteName('#__extensions'))
                ->where($db->quoteName('element') . ' = :extension');
        }
@svanschu
Copy link
Contributor Author

I'm working on it and will prepare a PR

@svanschu
Copy link
Contributor Author

Fixed in PR #42192

@svanschu
Copy link
Contributor Author

PR #42199

laoneo pushed a commit that referenced this issue Nov 3, 2023
In this method it tries to load the field 'id' from the extensions table. But there isn't any field called id in this table. The id field for the extenions table is called extension_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants