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

Fix PHP crash when copying course with OnlyOffice objects #7

Open
wants to merge 1 commit into
base: release_8
Choose a base branch
from

Conversation

jheim2
Copy link

@jheim2 jheim2 commented Aug 29, 2024

Set $title to an empty string if the "upload_files" key is missing from the $_POST array, preventing the PHP script from crashing when copying a course with OnlyOffice objects.

Set $title to an empty string if the "upload_files" key is missing from the `$_POST` array, preventing the PHP script from crashing when copying a course with OnlyOffice objects.
@rfalkenstein
Copy link

Some more context for reproduction:
The error report we receive is the following: "Whoops\Exception\ErrorException thrown with message "Trying to access array offset on value of type null".

#22 Whoops\Exception\ErrorException in /path/to/webroot/Customizing/global/plugins/Services/Repository/RepositoryObject/OnlyOffice/classes/class.ilObjOnlyOffice.php:79
#21 ilErrorHandling:handlePreWhoops in /path/to/webroot/Customizing/global/plugins/Services/Repository/RepositoryObject/OnlyOffice/classes/class.ilObjOnlyOffice.php:79
#20 ilObjOnlyOffice:doCreate in /path/to/webroot/Services/Object/classes/class.ilObject2.php:55
#19 ilObject2:create in /path/to/webroot/Services/Object/classes/class.ilObject.php:1600
#18 ilObject:cloneObject in /path/to/webroot/Services/Object/classes/class.ilObject2.php:129
#17 ilObject2:cloneObject in /path/to/webroot/webservice/soap/classes/class.ilSoapUtils.php:409
#16 ilSoapUtils:cloneNode in /path/to/webroot/webservice/soap/classes/class.ilSoapUtils.php:264
#15 ilSoapUtils:ilClone in /path/to/webroot/webservice/soap/include/inc.soap_functions.php:464
#14 ilSoapFunctions:ilClone in /path/to/webroot/webservice/soap/classes/class.ilSoapUtils.php:356
#13 ilSoapUtils:callNextNode in /path/to/webroot/webservice/soap/classes/class.ilSoapUtils.php:265
#12 ilSoapUtils:ilClone in /path/to/webroot/webservice/soap/include/inc.soap_functions.php:464
#11 ilSoapFunctions:ilClone in /path/to/webroot/Services/Container/classes/class.ilContainer.php:555
#10 ilContainer:cloneAllObject in /path/to/webroot/Services/Object/classes/class.ilObjectCopyGUI.php:1071
#9 ilObjectCopyGUI:copyContainer in /path/to/webroot/Services/Object/classes/class.ilObjectCopyGUI.php:920
#8 ilObjectCopyGUI:copyContainerToTargets in /path/to/webroot/Services/Object/classes/class.ilObjectCopyGUI.php:138
#7 ilObjectCopyGUI:executeCommand in /path/to/webroot/Services/UICore/classes/class.ilCtrl.php:203
#6 ilCtrl:forwardCommand in /path/to/webroot/Modules/Category/classes/class.ilObjCategoryGUI.php:196
#5 ilObjCategoryGUI:executeCommand in /path/to/webroot/Services/UICore/classes/class.ilCtrl.php:203
#4 ilCtrl:forwardCommand in /path/to/webroot/Services/Repository/classes/class.ilRepositoryGUI.php:243
#3 ilRepositoryGUI:show in /path/to/webroot/Services/Repository/classes/class.ilRepositoryGUI.php:223
#2 ilRepositoryGUI:executeCommand in /path/to/webroot/Services/UICore/classes/class.ilCtrl.php:203
#1 ilCtrl:forwardCommand in /path/to/webroot/Services/UICore/classes/class.ilCtrl.php:178
#0 ilCtrl:callBaseClass in /path/to/webroot/ilias.php:24

We can reproduce this error not only when copying a course with an OO object but also when copying an OO-object.

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

Successfully merging this pull request may close these issues.

2 participants