mambax7 / publisher

Publishing module for XOOPS for static/HTML content and articles stored and provided in a hierarchical manner
GNU General Public License v2.0
1 stars 1 forks source link

When admin edit article on submit,have A problem. #19

Closed CHCCD closed 2 years ago

CHCCD commented 2 years ago

My server PHP 8.0.14 XOOPS 2.5.11-Beta2 The url xoop_url/modules/publisher/admin/item.php?op=mod&itemid=1 When admin edit article on submit,have A problem has occurred on our server! message: Error: TypeError: is_uploaded_file(): Argument #1 ($filename) must be of type string, null given in file /modules/publisher/class/Utility.php line 1144

mambax7 commented 2 years ago

Are you adding a new file? A new image?
Or are you just editing the article, and an image/file were already included there?

CHCCD commented 2 years ago

Permissions problem If File upload not set ,On admin panel edit article have the error. Error: TypeError: is_uploaded_file(): Argument #1 ($filename) must be of type string, null given in file /modules/publisher/class/Utility.php line 1144

mambax7 commented 2 years ago

I can't reproduce it:

But I didn't have any attachments (no files and no images), that's why I've asked if you had any of those...

mambax7 commented 2 years ago

Wait, I think, I understand what you're saying. Let me test it without the "File upload" permission.... Are you trying to allow users to submit articles but without the permission to attach files?

mambax7 commented 2 years ago

Change the line 1144 to this: if ($helper->getConfig('perm_upload') && \is_uploaded_file(($_FILES['item_upload_file']['tmp_name'])??'')) {

This will fix it

mambax7 commented 2 years ago

Thanks for reporting the issue!