Probable Core issues installing and uninstalling.

Permalink Browser Info Environment
I got errors installing and uninstalling. I cannot uninstall it to try to figure out the exact install error, but I'll show you how I fixed it.

My installing error was:
/updates/concrete-cms-9.1.3/concrete/src/Antispam/Library.php
if (is_array($r) && $r['saslHandle']) {  <-- Error Line 100
Fixed by adding Line 99
$r['saslHandle'] = [];


After I fixed this error and reinstalled with no issues, I got this error when trying to uninstall.
My uninstalling error was:
Call to a member function getSystemAntispamLibraryName() on null
/updates/concrete-cms-9.1.3/concrete/src/Package/ItemCategory/AntispamLibrary.php
    public function getItemName($library)
    {
        return $library->getSystemAntispamLibraryName();  <-- Error Line 19
    }

Type: Ticket
Status: Resolved
mdius
View Replies:
mnakalay replied on at Permalink Reply
mnakalay
that's a core issue it seems.

Without an error message I don't really know why the error happened during installation but I'm guessing it's a PHP 8 error.

If that's the case the fix should have been:
if (is_array($r) && isset($r['saslHandle']) && $r['saslHandle']) {

What I can say is when you used your fix during installation you made the antispam library's handle empty and most likely saved it like that

So, my guess is, now when you want to uninstall it, it's trying to fetch it by handle and finds nothing so it breaks

If you could share the exact errors that would help

A possible solution to be able to uninstall would be to look inside the SystemAntispamLibraries database table for an entry where the column saslHandle is empty. If you find one, give it's saslHandle the value
kalmoya_anti_spammer_master
mdius replied on at Permalink Reply
mdius
So, the SystemAntispamLibraries database table had a column that had the kalmoya_anti_spammer_master value in it already, so I deleted it and was able to uninstall it.
Now, beofre adding your fix and trying to install I got
Whoops \ Exception \ ErrorException (E_WARNING)
Undefined array key "saslHandle"

I added your fix, which fixed the installing and uninstalling issue.
Thank you!
mdius replied on at Permalink Reply
mdius
Now a new error, when clicked Go to Spam Control on your Installation Notes and I selected Anti-Spammer Master from Active Library.

Whoops \ Exception \ ErrorException (E_WARNING)
Undefined array key "logging.checkNumberOfLinks"
/packages/kalmoya_anti_spammer_master/src/AntiSpammerMaster/Helpers/Settings.php
    public function get($handle)
    {
        $default = $this->defaultValues[$handle];   <-- Error line 28
        $value = $this->config->get($this->configPrefix . $handle, $default);
        return is_null($value) ? $default : $value;
    }
mnakalay replied on at Permalink Reply
mnakalay
Thank you for pointing that out. Please update to 2.0.4, and you should be good to go.

If you like the package and had the time for a little review, that would really make my day :)

Thank you.
mdius replied on at Permalink Reply
mdius
Still having issues.
I was able to get it all set up and that went smooth.
But now when I submitted a message, I get:
Whoops \ Exception \ ErrorException (E_WARNING)
Undefined array key "totalSpamBlockedByType.checkMessageLengthAndWords"
/packages/kalmoya_anti_spammer_master/src/AntiSpammerMaster/Helpers/Statistics.php
    public function get($handle)
    {
        $default = $this->defaultValues[$handle];    <-- Error Line 28
        $value = $this->config->get($this->configPrefix . $handle, $default);
mnakalay replied on at Permalink Reply
mnakalay
All issues resolved

concrete5 Environment Information

# Concrete Version
Core Version - 9.1.3
Version Installed - 9.1.3
Database Version - 20220908074900

# Environment
production

# Database Information
Version: 8.0.31
SQL Mode: STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

# Concrete Packages
Abandoned Cart (0.9.0), Advanced HTML Block (1.2), Advanced Image (2.1.0), Advanced Page Title (2.0.1), Anti-Spammer Master (2.0.3), Authorize.Net Payment Method (1.0.4), Community Store (2.4.7.8), Community Store Add-On (0.9.0), Community Store EasyPost Shipping (2.2), Community Store Shipping for Hg Products (1.0.1), Concrete Custom Form Add-On (1.0.1), Mega Menu (2.0.1), Multiple Product Editing (2.4.0), Paypal Payment Method (1.2.2), Styled Maps (2.0.1), Tallacmans Copyright (1.5.1)

# Concrete Cache Settings
Block Cache - Off
Overrides Cache - Off
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
fpm-fcgi

# PHP Version
8.1.12

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dom, fileinfo, filter, ftp, gd, hash, iconv, imap, json, libxml, mbstring, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, session, SimpleXML, sockets, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, zlib

# PHP Settings
max_execution_time - 30
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 1024M
post_max_size - 256M
upload_max_filesize - 256M
zend.exception_string_param_max_len - 15
mbstring.regex_retry_limit - 1000000
mbstring.regex_stack_limit - 100000
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
unserialize_max_depth - 4096

Browser User-Agent String

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.