Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

DatabaseDetector.php raises Exception in ILIAS 7-26 & v2023.01.26 #42

Open
valid0r opened this issue Oct 30, 2023 · 3 comments · May be fixed by #43
Open

DatabaseDetector.php raises Exception in ILIAS 7-26 & v2023.01.26 #42

valid0r opened this issue Oct 30, 2023 · 3 comments · May be fixed by #43

Comments

@valid0r
Copy link

valid0r commented Oct 30, 2023

When creating a new LiveVoting object an ilias error messages is thrown. The content of the exception is as follows:

Whoops\Exception\ErrorException thrown with message "Class srag\DIC\LiveVoting\Database\DatabaseDetector contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (ilDBInterface::primaryExistsByFields)"

Stacktrace:
#2 Whoops\Exception\ErrorException in /[...]/ilias/Customizing/global/plugins/Services/Repository/RepositoryObject/LiveVoting/vendor/srag/dic/src/Database/DatabaseDetector.php:19
#1 Whoops\Run:handleError in /[...]/ilias/libs/composer/vendor/filp/whoops/src/Whoops/Run.php:514
#0 Whoops\Run:handleShutdown in [internal]:0


-- GET Data --

ref_id                   : 432545
cmd                      : content
cmdClass                 : xlvovotinggui
cmdNode                  : rt:qv:1bi
baseClass                : ilobjplugindispatchgui
lang                     : de
limit                    : 9999

We're using ILIAS v7.26 and the LiveVoting Release v2023.01.26.

@iFadi
Copy link

iFadi commented Nov 1, 2023

We updated today to ILIAS 7.26, because of the latest security ILIAS updates and facing the same issue, where can we find the "2023.09.18" Tag for the fix.

Thanks
Kind Regards.

@iFadi
Copy link

iFadi commented Nov 1, 2023

@valid0r

I've added a dirty-patch to fix the issue. edit DatabaseDetector.php from the {ILIAS Root}:

vim Customizing/global/plugins/Services/Repository/RepositoryObject/LiveVoting/vendor/srag/dic/src/Database/DatabaseDetector.php

and add this function after this line:
protected static $instance = null;

/**
 * Implements the primaryExistsByFields method from ilDBInterface.
 *
 * This method was added to address compatibility issues with newer versions
 * of ILIAS, specifically ILIAS8 and ILIAS7
 * @see https://github.com/ILIAS-eLearning/ILIAS/commit/3d4ccc6a24d5d3e487d9e303a41a7bb12262eb48
 *
 * @param string $table_name The name of the table.
 * @param array $fields An array of fields.
 * @return bool A stub return. This should be adjusted based on the actual implementation.
 */
public function primaryExistsByFields(string $table_name, array $fields): bool
{
    // TODO: Implement the actual logic for this method.
    return false;
}

PS: I'm not this Plugin Developer, so NO WARRANTIES

@valid0r
Copy link
Author

valid0r commented Nov 2, 2023

@iFadi thanks for the Fix!

This seems to be a problem with a changed Interface between versions. @mstuder cann you confirm this and maybe add the fix to the upstream?

Thanks again to all involved!

iFadi added a commit to iFadi/LiveVoting that referenced this issue Nov 2, 2023
fixes fluxapps#42 - Implements the primaryExistsByFields method from ilDBInterface.
@iFadi iFadi linked a pull request Nov 2, 2023 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants