Skip to main content
Topic: Attachment settings error (Read 2153 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Attachment settings error

When i tried to open the attachment settings, i get this error.

X

 

Re: Attachment settings error

Reply #1
Version of php? 7.2 right?
I remember similar reports for other places, I don't remember if this one was reported yet.

You can replace any instance of:
Code: [Select]
count($modSettings['attachmentUploadDir']) == 1
with:
Code: [Select]
(is_array($modSettings['attachmentUploadDir']) && count($modSettings['attachmentUploadDir']) == 1)
in /sources/admin/ManageAttachments.controller.php
Bugs creator.
Features destroyer.
Template killer.

Re: Attachment settings error

Reply #2
@emanuele Thanks it solved the issue :)

Re: Attachment settings error

Reply #3
Might be a idea to use is_countable from php 7.3 and this polyfill

Code: [Select]
if (PHP_VERSION_ID < 70300) {
    if (!function_exists('is_countable')) {
        function is_countable($var) {
            return is_array($var) || $var instanceof Countable || $var instanceof ResourceBundle || $var instanceof SimpleXmlElement;
        }
    }
}

Re: Attachment settings error

Reply #4
Yes, thank you, that was it. :)
Is there a new BBC tag for this or do I have to write something in the text like [attach] ?
ElkArte version: 1.1.6 / Theme: BeSocial / PHP 7.2.7


Re: Attachment settings error

Reply #6
Ooops, you're right. I'll post it in the other too.
ElkArte version: 1.1.6 / Theme: BeSocial / PHP 7.2.7

Re: Attachment settings error

Reply #7
Version of php? 7.2 right?
I remember similar reports for other places, I don't remember if this one was reported yet.

You can replace any instance of:
Code: [Select]
count($modSettings['attachmentUploadDir']) == 1
with:
Code: [Select]
(is_array($modSettings['attachmentUploadDir']) && count($modSettings['attachmentUploadDir']) == 1)
in /sources/admin/ManageAttachments.controller.php

Has this been committed in 1.1.4?