OJS 3.4.0-1 Custom Block Manager error to save if the content image?

Hello,
When I try to add a new item under Custom Blocks, the information is not saved if the content image is uploaded locally or is an external URL.
The Save button becomes light gray but not saved.
All add new item work normally if they are only texts.

I use :OJS 3.4.0-1

Hi @Nasseer,

Hmm… are you able to provide the output of your PHP error logs?

-Roger
PKP Team

Hello @rcgillis ,
Now when trying I get these errors

And the error file records these errors every time I try to insert an image with the custom block manager:
[19-Jul-2023 16:05:56 Asia/Baghdad] PHP Deprecated: Return type of Slim\Collection::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/ddfcd/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Collection.php on line 112
[19-Jul-2023 16:05:56 Asia/Baghdad] PHP Deprecated: Return type of Slim\Collection::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/ddfcd/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Collection.php on line 124
[19-Jul-2023 16:05:56 Asia/Baghdad] PHP Deprecated: Return type of Slim\Collection::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/ddfcd/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Collection.php on line 135

[19-Jul-2023 16:05:56 Asia/Baghdad] PHP Deprecated: Return type of Slim\Collection::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/ddfcd/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Collection.php on line 145

[19-Jul-2023 16:05:56 Asia/Baghdad] PHP Deprecated: Return type of Slim\Collection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/ddfcd/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Collection.php on line 155

[19-Jul-2023 16:05:56 Asia/Baghdad] PHP Deprecated: Return type of Slim\Collection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/ddfcd/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Collection.php on line 165

[19-Jul-2023 16:05:56 Asia/Baghdad] PHP Deprecated: Return type of Slim\Collection::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/ddfcd/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Collection.php on line 112

[19-Jul-2023 16:05:56 Asia/Baghdad] PHP Deprecated: Return type of Slim\Collection::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/ddfcd/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Collection.php on line 124

[19-Jul-2023 16:05:56 Asia/Baghdad] PHP Deprecated: Return type of Slim\Collection::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/ddfcd/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Collection.php on line 135

[19-Jul-2023 16:05:56 Asia/Baghdad] PHP Deprecated: Return type of Slim\Collection::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/ddfcd/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Collection.php on line 145

[19-Jul-2023 16:05:56 Asia/Baghdad] PHP Deprecated: Return type of Slim\Collection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/ddfcd/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Collection.php on line 155

[19-Jul-2023 16:05:56 Asia/Baghdad] PHP Deprecated: Return type of Slim\Collection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/ddfcd/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Collection.php on line 165

[19-Jul-2023 16:05:56 Asia/Baghdad] PHP Deprecated: preg_replace_callback(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /home/ddfcd/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Http/Uri.php on line 716

Regards,

Hello @rcgillis

This problem still persists…and I tried a lot of solutions close to my problem, but to no avail. Can you help me, please

Hello @asmecher ,
Can you take a look at this case? There is no idea to help?

Regards,

Hi @Nasseer,

The plugin is working fine on my environment, this is the button that you’re missing:
image

How did you install OJS 3.4? If you’ve installed it from GitHub, perhaps you’ve forgotten to update the NPM packages and re-run the build. Perhaps your browser console has better insights of what’s happening there.

Best,
Jonas Raoni

Hello @jonasraoni,
Thanks for the reply and help.
Regarding the tag, this button is present as in the attached screenshot:

As for the download, I downloaded it from the official website: https://pkp.sfu.ca/ojs/download/ojs-3.4.0-1.tar.gz
After I tried many possible solutions, I can add this information to the problem
1-The problem includes all textarea have WYSIWYG HTML editor( TinyMCE )
2-The strangest of all is when I change the code from the database in the table plugin_settings
This modification does not appear, and the site continues to show the content of the old text. as in the screenshot :

my shot 3

Regards,
Nasseer

Oh, I skipped the first message and thought that you just had problem with the “Failed to initialize plugin: pkpTags” :slight_smile:

It’s working fine for me here, so I guess it must be something on your environment. If the problem is on the server, there should be probably an error on the error log, but I didn’t see anything, just warnings…

I understood you’re able to upload the image to the HTML editor, and that the failure just happens when it’s time to save, right?

So, another thing that you can try is to open the browser’s developer tools (press F12), before clicking on the save button, and check if:

  • New errors appear on the console
    image

  • The outcome of the network request

    In order to visualize better, it might help to clear the existing requests before:

    image

    Here’s how a successful request should look like:


Then, about updating the value directly on the database, I think you’ll need to clear the cache to make it work. On the “Administration” interface, there will be this button:

image

Best,
Jonas Raoni

Hi @jonasraoni
Thank you for help.
About:I understood you’re able to upload the image to the HTML editor, and that the failure just happens when it’s time to save, right?

Yes without any problem.

Regarding the rest of the tests, the results are in the Screenshot:

In addition, the server error log records errors with protection rules and a ticket slot with the server’s technical support. Fix the bug?

Hmm, that’s a permission issue, but not generated by the application. There’s something blocking the request to this URL.

I’ve seen some people having issues with firewalls, they were blocking the request due to the presence of “$$call$$$” in the URL, which is our case (https://…/$$$call$$$/plugins/generic/custom-block-manager/controllers/grid/custom-block-grid/update-custom-block).

If it’s not your firewall, then perhaps there’s something not very well configured on your web server. And unfortunately, I’m unable to help you further with that.

Best,
Jonas Raoni

Hello @jonasraoni,
Exactly what you say is because of my firewall,
After many attempts, the support team in the hosting company was able to fix the defect, and now it is working normally.
Thanks for all the help you gave me.

Regards,
Nasseer

1 Like

Hi @Nasseer,

As it’s not the first time I’ve seen this, I’ll create an issue to propose a fix for it. What’s the firewall that you’re using?

Best,
Jonas

Hello @jonasraoni ,
thanks for the help
This will be useful to other members
Especially since the errors that appear in the errors file do not clearly indicate who is the cause of the problem
I Use ConfigServer Security & Firewall - csf + imunify360 But some imunify360 rules are the cause of this problem

Regards,
Nasseer

1 Like