Problem/Motivation

After enabling the animatecss_block module placing any new block from block_layout was sending the below error.

Object { message: '\nAn AJAX HTTP error occurred.\nHTTP Result Code: 200\nDebugging information follows.\nPath: /admin/structure/block/add/entity_view%3Anode/mtcbtheme_bs4?region=drawer_top\nStatusText: parsererror\nResponseText: Deprecated: strtr(): Passing null to parameter #1 ($string) of type string is deprecated in /app/docroot/modules/contrib/animatecss_block/src/Service/AnimateCssBlockHelperService.php on line 248\n[{"command":"settings","settings":{"ajaxPageState":{"theme":"vartheme_claro","theme_token":"aUVtYr7GmL5_ALCKifq0yPq-GSLeEKPAdQWjPDSSF28","libraries":"eJx9U1GWpCAMvBDqGfYkvoBpzWskPhLdnT39RlSmnd6ZHyFVRSRFAsNMqVfm6CF359pqRnTwLdVOvGGmpJj0LiurVDEFTg4SzaAYRHofOTy7E2hK9EqvVLkwpGbAzXka-4UW7K6NO3IMeV0gtkeKd6gtt3JhYsHUHUvr8XEhp_aITrCP5C-p3caFCJkvZYKtUfCG8uOBWBOUyEDz4o-uED-JC2kipaf8LDn9MlGuqSEobVhO3_DAMcIieAOHzItfVc3uV3iGMFHCJsF814uayXKDrLqIE8KA-R3PKAsnsQvdOOsCpbAXcFhjTOI8Q6S_6Oz50Irdv7VATBtlTrM1Tk9psLPK-cr2X9KZRbsHVXSETlCV0ii9ZvioZb2CTibOGlat7Bk74UAQ-xkHgr48T_cOtTqhuab8tH4pX_d1FlACLPirtJqy2vn9TTPHToMB66…', name: "AjaxError", stack: "@https://mtcbenin.lndo.site/core/misc/ajax.js?v=10.3.3:196:32\n@https://mtcbenin.lndo.site/core/misc/ajax.js?v=10.3.3:1921:3\n" }

Steps to reproduce

- Enable the module.
- From Block layout page try to place a new block to any region

Proposed resolution

i am not expert but, after reading another similar issue on paragraph i try imitating a patch they provided here. i attach my imitated patch here

Remaining tasks

- Maintainer confirm it's the correct solution
- Test and review for the patch

Comments

delacosta456 created an issue. See original summary.

delacosta456’s picture

Issue summary: View changes
ananya.k’s picture

Assigned: Unassigned » ananya.k
delacosta456’s picture

Version: 1.0.0 » 1.0.0-beta1
delacosta456’s picture

Version: 1.0.0-beta1 » 1.0.0
ananya.k’s picture

Assigned: ananya.k » Unassigned
StatusFileSize
new9.16 KB
new184.72 KB

I applied this patch(passing_null_deprecated.patch), and it worked for me. the issue has been resolved. I have also attached a screenshot.

delacosta456’s picture

hi @ananyak
Thanks for testing ..
Let us wait for the maintainer's test.

How ever i also noticed that when the module is enable and this bug around together with the patch, hitting the "Save Blocks" button under all blocks at structure/block/list returned an error Fatal error: Allowed memory size of 536870912 bytes exhausted ..
Maybe the maintainer will also help for this

Thanks

mahyarsbt’s picture

Version: 1.0.0 » 1.0.x-dev
Component: User interface » Code
Assigned: Unassigned » mahyarsbt
Status: Active » Needs review
StatusFileSize
new1.49 KB

Hi @delacosta456, @ananya.k,

Thanks for your efforts in testing and reporting! Based on the previous feedback, I’ve made further improvements to address the deprecated warning when passing null to the `strtr()` function. In addition, I've thoroughly tested the patch to ensure that it resolves the "memory exhausted" error that was also occurring with the previous patch.

Could you please test it again on your end and let me know if it resolves both issues?

mahyarsbt’s picture

Status: Needs review » Fixed

I had been waiting for feedback on the previous patch, but since I haven’t received a response, I took the initiative to personally test the patch in various scenarios. Based on my testing, the issue appears to be resolved.

Additionally, I have released the latest version of the module, which includes the fixes and improvements. You can now use the updated version.

mahyarsbt’s picture

Status: Fixed » Closed (fixed)

If you encounter any further issues or have additional questions, feel free to reach out, and I will be happy to assist you.

Thank you for your contributions and feedback!