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
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | animatecss_block-3477302-fix-deprecated-warning.patch | 1.49 KB | mahyarsbt |
| #6 | Screenshot_5.png | 184.72 KB | ananya.k |
| #6 | animatecss.png | 9.16 KB | ananya.k |
| passing_null_deprecated.patch | 1014 bytes | delacosta456 |
Comments
Comment #2
delacosta456 commentedComment #3
ananya.k commentedComment #4
delacosta456 commentedComment #5
delacosta456 commentedComment #6
ananya.k commentedI applied this patch(passing_null_deprecated.patch), and it worked for me. the issue has been resolved. I have also attached a screenshot.
Comment #7
delacosta456 commentedhi @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
Comment #8
mahyarsbt commentedHi @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?
Comment #9
mahyarsbt commentedI 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.
Comment #10
mahyarsbt commentedIf 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!