ElkArte Community

Elk Development => Bug Reports => Exterminated Bugs => Topic started by: Jason on May 20, 2018, 09:29:57 am

Title: Attachment settings error
Post by: Jason on May 20, 2018, 09:29:57 am
When i tried to open the attachment settings, i get this error.

X
Title: Re: Attachment settings error
Post by: emanuele on May 20, 2018, 03:28:49 pm
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
Title: Re: Attachment settings error
Post by: Jason on May 20, 2018, 03:59:05 pm
@emanuele Thanks it solved the issue :)
Title: Re: Attachment settings error
Post by: tino on May 20, 2018, 08:26:00 pm
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;
        }
    }
}
Title: Re: Attachment settings error
Post by: Mrs. Chaos on June 01, 2018, 12:26:37 pm
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] ?
Title: Re: Attachment settings error
Post by: tino on June 01, 2018, 01:04:48 pm
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?
Title: Re: Attachment settings error
Post by: Mrs. Chaos on June 01, 2018, 01:11:47 pm
Ooops, you're right. I'll post it in the other too.
Title: Re: Attachment settings error
Post by: ahrasis on June 02, 2018, 07:04:14 am
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?
Title: Re: Attachment settings error
Post by: Spuds on April 07, 2019, 11:06:55 pm
https://github.com/elkarte/Elkarte/issues/3190