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] setCPid() must be of the type int, null given #1329

Open
fschoelzel opened this issue Sep 10, 2024 · 1 comment · May be fixed by #1334
Open

[BUG] setCPid() must be of the type int, null given #1329

fschoelzel opened this issue Sep 10, 2024 · 1 comment · May be fixed by #1334

Comments

@fschoelzel
Copy link
Contributor

fschoelzel commented Sep 10, 2024

Description

-- This Issue might be in the wrong Extension --

The settings array of the Slub/Dfgviewer/Controller/UriController is empty. So $doc->cPid is set to null instead of 0 if the storagePid is empty. (in this case the whole array is)
Without the cast to (int) it throws an error.

Reproduction

  1. reload the Site

Screenshots and Examples

error-cpid-1
error-cpid-2

Environment

  • OS version: Linux Mint 21 Cinnamon
  • RDBMS version: MariaDB 10.1
  • TYPO3 version: 11.5.38
  • PHP version: 7.4.33
  • Extensions: kitodo/presentation, slub/dfgviewer, slub/slub-digitalcollections

Additional Context

occurred after merging this PR:
#1324

@fschoelzel
Copy link
Contributor Author

@beatrycze-volk

  • Option 1: we get back to $doc->cPid = max((int) $this->settings['storagePid'], 0);
  • Option 2: we check for an existing settings array and storagePid key

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