Errors related with 'No file' option in the Filebase

  • Affected Version
    WoltLab Suite 5.5
    Affected App
    WoltLab Suite Filebase
    • In WoltLab Suite 5.5.17 you can add a file 'without file', but an error is generated when trying to add a review.
    • In WoltLab Suite 6.0.0 RC 2 the error is generated when you try to add a file 'without file', and directly breaks the Filebase


    WoltLab Suite 5.5.17 Error Message

    Requested URL
    POST /lab/legacy/filebase/index.php?file-review-add/1/
    Referrer
    https://aethior.com/lab/legacy/filebase/index.php?file-review-add/1-testfile/
    WoltLab Suite
    5.5.17
    PHP
    8.1.23
    Error Message
    Could not execute statement 'INSERT INTO filebase1_file_version_review (fileID,versionID,title,rating,time,userID,username,message,attachments,isDisabled) VALUES (?,?,?,?,?,?,?,?,?,?)'
    Type
    wcf\system\database\exception\DatabaseQueryExecutionException
    File (Line)
    /homepages/46/d834751442/htdocs/www/lab/legacy/lib/system/database/statement/PreparedStatement.class.php (144)
    Query Parameter 1
    1
    Query Parameter 2
    0
    Query Parameter 3
    'Test'
    Query Parameter 4
    5
    Query Parameter 5
    1695939021
    Query Parameter 6
    2
    Query Parameter 7
    'user'
    Query Parameter 8
    '<p>Test</p>'
    Query Parameter 9
    0
    Query Parameter 10
    0
    Stacktrace
    1. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/data/TFastCreate.class.php (44): wcf\system\database\statement\PreparedStatement->execute(…)
    2. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/data/DatabaseObjectEditor.class.php (28): wcf\data\DatabaseObjectEditor::dboEditorCreateBase(…)
    3. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/data/AbstractDatabaseObjectAction.class.php (355): wcf\data\DatabaseObjectEditor::create(…)
    4. /homepages/46/d834751442/htdocs/www/lab/legacy/filebase/lib/data/file/version/review/FileVersionReviewAction.class.php (104): wcf\data\AbstractDatabaseObjectAction->create(…)
    5. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/data/AbstractDatabaseObjectAction.class.php (216): filebase\data\file\version\review\FileVersionReviewAction->create(…)
    6. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/form/AbstractFormBuilderForm.class.php (188): wcf\data\AbstractDatabaseObjectAction->executeAction(…)
    7. /homepages/46/d834751442/htdocs/www/lab/legacy/filebase/lib/form/FileReviewAddForm.class.php (224): wcf\form\AbstractFormBuilderForm->save(…)
    8. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/form/AbstractForm.class.php (80): filebase\form\FileReviewAddForm->save(…)
    9. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/form/AbstractForm.class.php (152): wcf\form\AbstractForm->submit(…)
    10. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/form/AbstractFormBuilderForm.class.php (147): wcf\form\AbstractForm->readData(…)
    11. /homepages/46/d834751442/htdocs/www/lab/legacy/filebase/lib/form/FileReviewAddForm.class.php (117): wcf\form\AbstractFormBuilderForm->readData(…)
    12. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/page/AbstractPage.class.php (353): filebase\form\FileReviewAddForm->readData(…)
    13. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/page/AbstractPage.class.php (135): wcf\page\AbstractPage->show(…)
    14. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/system/request/Request.class.php (90): wcf\page\AbstractPage->__run(…)
    15. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/system/request/RequestHandler.class.php (107): wcf\system\request\Request->execute(…)
    16. /homepages/46/d834751442/htdocs/www/lab/legacy/filebase/index.php (11): wcf\system\request\RequestHandler->handle(…)
    Error Message
    SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails ("dbs12124486"."filebase1_file_version_review", CONSTRAINT "ec819c70965b83bad9d6774adb3cc18d_fk" FOREIGN KEY ("versionID") REFERENCES "filebase1_file_version" ("versionID") ON DELETE CASCADE)
    Type
    PDOException
    File (Line)
    /homepages/46/d834751442/htdocs/www/lab/legacy/lib/system/database/statement/PreparedStatement.class.php (126)
    Stacktrace
    1. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/system/database/statement/PreparedStatement.class.php (126): PDOStatement->execute(…)
    2. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/data/TFastCreate.class.php (44): wcf\system\database\statement\PreparedStatement->execute(…)
    3. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/data/DatabaseObjectEditor.class.php (28): wcf\data\DatabaseObjectEditor::dboEditorCreateBase(…)
    4. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/data/AbstractDatabaseObjectAction.class.php (355): wcf\data\DatabaseObjectEditor::create(…)
    5. /homepages/46/d834751442/htdocs/www/lab/legacy/filebase/lib/data/file/version/review/FileVersionReviewAction.class.php (104): wcf\data\AbstractDatabaseObjectAction->create(…)
    6. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/data/AbstractDatabaseObjectAction.class.php (216): filebase\data\file\version\review\FileVersionReviewAction->create(…)
    7. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/form/AbstractFormBuilderForm.class.php (188): wcf\data\AbstractDatabaseObjectAction->executeAction(…)
    8. /homepages/46/d834751442/htdocs/www/lab/legacy/filebase/lib/form/FileReviewAddForm.class.php (224): wcf\form\AbstractFormBuilderForm->save(…)
    9. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/form/AbstractForm.class.php (80): filebase\form\FileReviewAddForm->save(…)
    10. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/form/AbstractForm.class.php (152): wcf\form\AbstractForm->submit(…)
    11. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/form/AbstractFormBuilderForm.class.php (147): wcf\form\AbstractForm->readData(…)
    12. /homepages/46/d834751442/htdocs/www/lab/legacy/filebase/lib/form/FileReviewAddForm.class.php (117): wcf\form\AbstractFormBuilderForm->readData(…)
    13. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/page/AbstractPage.class.php (353): filebase\form\FileReviewAddForm->readData(…)
    14. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/page/AbstractPage.class.php (135): wcf\page\AbstractPage->show(…)
    15. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/system/request/Request.class.php (90): wcf\page\AbstractPage->__run(…)
    16. /homepages/46/d834751442/htdocs/www/lab/legacy/lib/system/request/RequestHandler.class.php (107): wcf\system\request\Request->execute(…)
    17. /homepages/46/d834751442/htdocs/www/lab/legacy/filebase/index.php (11): wcf\system\request\RequestHandler->handle(…)


    WoltLab Suite 6.0.0 RC 2 Error Message

    Requested URL
    GET /lab/beta/filebase/
    Referrer
    https://www.aethior.com/lab/beta/filebase/index.php?file-add/
    WoltLab Suite
    6.0.0 RC 2
    PHP
    8.1.23
    Error Message
    wcf\util\FileUtil::getIconNameByFilename(): Argument #1 ($filename) must be of type string, null given, called in /homepages/46/d834751442/htdocs/www/lab/beta/filebase/lib/data/file/ViewableFile.class.php on line 99
    Type
    TypeError
    File (Line)
    /homepages/46/d834751442/htdocs/www/lab/beta/lib/util/FileUtil.class.php (565)
    Stacktrace
    1. /homepages/46/d834751442/htdocs/www/lab/beta/filebase/lib/data/file/ViewableFile.class.php (99): wcf\util\FileUtil::getIconNameByFilename(…)
    2. /homepages/46/d834751442/htdocs/www/lab/beta/templates/compiled/0_filebase_2_fileList.php (1975): filebase\data\file\ViewableFile->getIconTag(…)
    3. /homepages/46/d834751442/htdocs/www/lab/beta/lib/system/template/TemplateEngine.class.php (340): include(…)
    4. /homepages/46/d834751442/htdocs/www/lab/beta/lib/page/AbstractPage.class.php (386): wcf\system\template\TemplateEngine->display(…)
    5. /homepages/46/d834751442/htdocs/www/lab/beta/lib/page/AbstractPage.class.php (134): wcf\page\AbstractPage->show(…)
    6. /homepages/46/d834751442/htdocs/www/lab/beta/lib/system/request/Request.class.php (57): wcf\page\AbstractPage->__run(…)
    7. /homepages/46/d834751442/htdocs/www/lab/beta/lib/http/middleware/HandleValinorMappingErrors.class.php (35): wcf\system\request\Request->handle(…)
    8. /homepages/46/d834751442/htdocs/www/lab/beta/lib/system/request/RequestHandler.class.php (143): wcf\http\Pipeline->process(…)
    9. /homepages/46/d834751442/htdocs/www/lab/beta/filebase/index.php (10): wcf\system\request\RequestHandler->handle(…)
  • SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails ("dbs12124486"."filebase1_file_version_review", CONSTRAINT "ec819c70965b83bad9d6774adb3cc18d_fk" FOREIGN KEY ("versionID") REFERENCES "filebase1_file_version" ("versionID") ON DELETE CASCADE)

    It's like: https://stackoverflow.com/questions/1406…ate-a-child-row


    Maybe the version the review was written for got deleted while writing the review?

    Managed Webhosting, hochwertige Plugins und individuelle Auftragsarbeiten:

    Julian-Pfeil.de

  • Hi @Julian Pfeil!

    The error was found in another installation. This installation has been installed in an attempt to reproduce the error. The error is reproducible in different installations.

    Edited. The error is related to the 'No file' option. Added all the information in the first post, with tests on different versions.

  • Aethior September 29, 2023 at 1:39 AM

    Changed the title of the thread from “Error when trying to write a review in the filebase” to “Errors related with 'No file' option in the Filebase”.
  • Marcel Werk October 5, 2023 at 3:57 PM

    Added the Label 6.0.0
  • Marcel Werk October 5, 2023 at 3:57 PM

    Added the Label 5.5.18
  • Marcel Werk October 5, 2023 at 3:57 PM

    Added the Label Fixed

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!