Skip to main content
Topic: Attachment settings error (Read 5144 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.

attach.PNG

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 :)
Last Edit: May 20, 2018, 10:05:13 am by Jason

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.8 / Theme: BeSocial / PHP 8.0

Re: Attachment settings error

Reply #5

Quote from: Mrs. Chaos – 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] ?

I think this is the wrong thread?

Re: Attachment settings error

Reply #6

Ooops, you're right. I'll post it in the other too.
ElkArte version: 1.1.8 / Theme: BeSocial / PHP 8.0

Re: Attachment settings error

Reply #7

Quote from: emanuele – 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?