Redactor/HTMLPurifier won't allow entry update CraftCMS - htmlpurifier

I'm fairly new to all this.... can you guys help me work out what is wrong here?
Most of my site is fine. When I try to edit a Redactor Field however, I get the error
Class 'HTMLPurifier_AttrDef_HTML_ContentEditable' not found
If I press "Save" it just gives me a craft styled INTERNAL SERVER ERROR page
Stack Trace from craft's web.log file... This happens when trying to save an entry on my production server (DigitalOcean, RunCloud). Works fine on my development stack (Lando)
2022-10-11 16:51:02 [-][1][u3gqq1j4ho4jmi8dnbbdtm0e9u][error][Error] Error: Class 'HTMLPurifier_AttrDef_HTML_ContentEditable' not found in /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php:44
Stack trace:
#0 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModuleManager.php(77): HTMLPurifier_AttrTypes->__construct()
#1 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLDefinition.php(187): HTMLPurifier_HTMLModuleManager->__construct()
#2 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php(630): HTMLPurifier_HTMLDefinition->__construct()
#3 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php(611): HTMLPurifier_Config->initDefinition()
#4 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/craftcms/cms/src/helpers/HtmlPurifier.php(51): HTMLPurifier_Config->getDefinition()
#5 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/yiisoft/yii2/helpers/BaseHtmlPurifier.php(53): craft\helpers\HtmlPurifier::configure()
#6 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/craftcms/html-field/src/HtmlField.php(193): yii\helpers\BaseHtmlPurifier::process()
#7 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/craftcms/redactor/src/Field.php(506): craft\htmlfield\HtmlField->serializeValue()
#8 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/craftcms/cms/src/base/Element.php(2150): craft\redactor\Field->serializeValue()
#9 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/yiisoft/yii2/validators/InlineValidator.php(84): craft\base\Element->validateCustomFieldContentSize()
#10 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/yiisoft/yii2/validators/Validator.php(261): yii\validators\InlineValidator->validateAttribute()
#11 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/yiisoft/yii2/base/Model.php(367): yii\validators\Validator->validateAttributes()
#12 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/craftcms/cms/src/services/Elements.php(2562): yii\base\Model->validate()
#13 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/craftcms/cms/src/services/Elements.php(785): craft\services\Elements->_saveElementInternal()
#14 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/craftcms/cms/src/controllers/EntriesController.php(407): craft\services\Elements->saveElement()
#15 [internal function]: craft\controllers\EntriesController->actionSaveEntry()
#16 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#17 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams()
#18 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction()
#19 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/craftcms/cms/src/web/Application.php(293): yii\base\Module->runAction()
#20 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/craftcms/cms/src/web/Application.php(602): craft\web\Application->runAction()
#21 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/craftcms/cms/src/web/Application.php(272): craft\web\Application->_processActionRequest()
#22 /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest()
#23 /home/teraukura/webapps/Te_Raukura/Te-Raukura/web/index.php(21): yii\base\Application->run()
#24 {main}
Also get this in the log sometimes?
[12-Oct-2022 15:38:55 Pacific/Auckland] PHP Fatal error: Trait 'GuzzleHttp\ClientTrait' not found in /home/teraukura/webapps/Te_Raukura/Te-Raukura/vendor/guzzlehttp/guzzle/src/Client.php on line 17

Related

Unable to login into Plesk panel

we have the problem that we are unable to login into our Plesk dashboard due to a error message which is shown when we are trying to enter the login page. We are looking for the issue at the moment and a solution to that. Maybe anyone has a suggestions for me what is the reason for this error?
ERROR: Uncaught Zend_Log_Exception: Unable to write to stream in /opt/psa/admin/plib/vendor/plesk/zf1/library/Zend/Log/Writer/Stream.php:135 Stack trace: #0 /opt/psa/admin/plib/vendor/plesk/zf1/library/Zend/Log/Writer/Abstract.php(88): Zend_Log_Writer_Stream->_write(Array) #1 /opt/psa/admin/plib/vendor/plesk/zf1/library/Zend/Log.php(464): Zend_Log_Writer_Abstract->write(Array) #2 /opt/psa/admin/plib/Plesk/Log.php(265): Zend_Log->log('Unable to write...', 3, Array) #3 /opt/psa/admin/plib/Plesk/Log.php(168): Plesk_Log::log('panel', 3, 'Unable to write...') #4 /opt/psa/admin/plib/PleskException.php(26): Plesk_Log::err('Unable to write...') #5 /opt/psa/admin/plib/PleskException.php(13): report_crash('Unable to write...', Array, 'Zend_Log_Except...', 500, Object(Zend_Log_Exception)) #6 [internal function]: plesk_exception_handler(Object(Zend_Log_Exception)) #7 {main} thrown (Stream.php:135)

Error running generator.dart to create Dart client library for App Engine API

Am getting the following stack trace when running the following command:
dart generate.dart package -input googleapis-discovery-documents/ -output googleapis/
My downloaded App Engine API discovery doc is inside googleapis-discovery-documents/ in the current directory.
NoSuchMethodError: method not found: 'toLowerCase'
Receiver: null
Arguments: []
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#1 ApisPackageGenerator.generateApiPackage (package:discoveryapis_generator/src/apis_package_generator.dart:70:49)
#2 generateApiPackage (package:discoveryapis_generator/discoveryapis_generator.dart:53:49)
#3 generateAllLibraries (package:discoveryapis_generator/discoveryapis_generator.dart:64:28)
#4 main (file:///home/tom/work/dart/dart-sdk/discovery_api_dart_client_generator/bin/generate.dart:112:40)
#5 _startIsolate (dart:isolate-patch/isolate_patch.dart:237)
#6 _startMainIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:192)
#7 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:130)**

Issue with exporting i18n in cake 2.3

I am trying to do an export of the pot file. Everything is running fine until I get this error:
Class OscProductRelationshipRelation does not exist
#0 /var/www/html/cakephp/cakephp-
2.3/Cake/Console/Command/Task/ExtractTask.php(446): ReflectionClass-
>__construct('OscProductRelat...')
#1 /var/www/html/cakephp/cakephp-
2.3/Cake/Console/Command/Task/ExtractTask.php(281): ExtractTask-
>_extractValidationMessages()
#2 /var/www/html/cakephp/cakephp-
2.3/Cake/Console/Command/Task/ExtractTask.php(232): ExtractTask->_extract()
#3 /var/www/html/cakephp/cakephp-2.3/Cake/Console/Shell.php(388):
ExtractTask->execute()
#4 /var/www/html/cakephp/cakephp-2.3/Cake/Console/Shell.php(385): Shell-
>runCommand('execute', Array)
#5 /var/www/html/cakephp/cakephp-2.3/Cake/Console/ShellDispatcher.php(199):
Shell->runCommand('extract', Array)
#6 /var/www/html/cakephp/cakephp-2.3/Cake/Console/ShellDispatcher.php(67):
ShellDispatcher->dispatch()
#7 /var/www/html/cakephp/cakephp-2.3/Cake/Console/cake.php(43):
ShellDispatcher::run(Array)
I did not find anything online about this error. Does anyone know what to do?

CakePHP empty error in error log

We have a website that everytime you go to the home page, gets an empty error logged in the error log.
2015-01-26 14:52:27 Error: [NotFoundException] Not Found
Request URL: /
Stack Trace:
#0 /var/www/vhosts/.nl/subdomains//httpdocs/lib/Cake/View/View.php(948): include()
#1 /var/www/vhosts/.nl/subdomains//httpdocs/lib/Cake/View/View.php(910): View->_evaluate('/var/www/vhosts...', Array)
#2 /var/www/vhosts/.nl/subdomains//httpdocs/lib/Cake/View/View.php(471): View->_render('/var/www/vhosts...')
#3 /var/www/vhosts/.nl/subdomains//httpdocs/lib/Cake/Controller/Controller.php(954): View->render('home', NULL)
#4 /var/www/vhosts/.nl/subdomains//httpdocs/app/Controller/PagesController.php(41): Controller->render('home')
#5 [internal function]: PagesController->display('home')
#6 /var/www/vhosts/.nl/subdomains//httpdocs/lib/Cake/Controller/Controller.php(490): ReflectionMethod->invokeArgs(Object(PagesController), Array)
#7 /var/www/vhosts/.nl/subdomains//httpdocs/lib/Cake/Routing/Dispatcher.php(191): Controller->invokeAction(Object(CakeRequest))
#8 /var/www/vhosts/.nl/subdomains//httpdocs/lib/Cake/Routing/Dispatcher.php(165): Dispatcher->_invoke(Object(PagesController), Object(CakeRequest))
#9 /var/www/vhosts/.nl/subdomains//httpdocs/app/webroot/index.php(108): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#10 {main}
I have no idea what causes this error. I tried deleting the whole file so you only see a blank page, but then the error still logs. Can someone point me in the right direction?
EDIT to answer some questions:
We have two layouts. One normal default.ctp and a home.ctp, the home page only has the layout/home.ctp, no pages/home.ctp.
It turns out my project missed the "Views/Pages/home.ctp" file. The website has two Layouts, home.ctp and default.ctp (for the rest of the pages). Because we didn't have anything in "Views/Pages/home.ctp" we deleted the file, but because of that we got the error. When we put back the file (with nothing in it) the error went away.
If you want to read more of the problem, look at the links ndm provided, the solved my question!

Cake bake "`stream` not a ConsoleOutput nor string" error

I seem to be getting cryptic errors when I am trying to bake certain views and controllers. The models baked okay (one died with a similar message building tests), and all the controllers baked okay bar one with the following error message:
Error: `stream` not a ConsoleOutput nor string
#0 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Log/LogEngineCollection.php(43): ConsoleLog->__construct(Array)
#1 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Log/CakeLog.php(199): LogEngineCollection->load('stdout', Array)
#2 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Shell.php(841): CakeLog::config('stdout', Array)
#3 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Shell.php(176): Shell->_useLogger()
#4 [internal function]: Shell->__construct(Array)
#5 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Utility/ClassRegistry.php(168): ReflectionClass->newInstance(Array)
#6 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Model/Model.php(1032): ClassRegistry::init(Array)
#7 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Model/Model.php(858): Model->_constructLinkedModel('Projecttask', 'Projecttask', NULL)
#8 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Model/Model.php(888): Model->__isset('Projecttask')
#9 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/Task/ViewTask.php(459): Model->__get('Projecttask')
#10 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/Task/ViewTask.php(285): ViewTask->_associations(Object(Project))
#11 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/Task/ViewTask.php(224): ViewTask->_loadController()
#12 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/Task/ViewTask.php(91): ViewTask->_interactive()
#13 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(111): ViewTask->execute()
#14 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#15 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#16 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#17 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#18 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#19 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#20 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#21 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#22 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#23 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#24 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#25 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#26 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#27 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#28 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#29 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#30 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#31 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#32 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#33 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#34 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#35 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#36 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#37 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#38 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#39 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#40 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#41 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#42 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#43 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#44 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#45 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Shell.php(392): BakeShell->main()
#46 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/ShellDispatcher.php(200): Shell->runCommand(NULL, Array)
#47 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/ShellDispatcher.php(68): ShellDispatcher->dispatch()
#48 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/cake.php(50): ShellDispatcher::run(Array)
#49 {main}
When I bake views for a previously baked model and controller I get:
Error: `stream` not a ConsoleOutput nor string
#0 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Log/LogEngineCollection.php(43): ConsoleLog->__construct(Array)
#1 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Log/CakeLog.php(199): LogEngineCollection->load('stdout', Array)
#2 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Shell.php(841): CakeLog::config('stdout', Array)
#3 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Shell.php(176): Shell->_useLogger()
#4 [internal function]: Shell->__construct(Array)
#5 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Utility/ClassRegistry.php(168): ReflectionClass->newInstance(Array)
#6 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Model/Model.php(1032): ClassRegistry::init(Array)
#7 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Model/Model.php(858): Model->_constructLinkedModel('Projecttask', 'Projecttask', NULL)
#8 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Model/Model.php(888): Model->__isset('Projecttask')
#9 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/Task/ViewTask.php(459): Model->__get('Projecttask')
#10 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/Task/ViewTask.php(285): ViewTask->_associations(Object(Projecttasknote))
#11 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/Task/ViewTask.php(224): ViewTask->_loadController()
#12 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/Task/ViewTask.php(91): ViewTask->_interactive()
#13 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(111): ViewTask->execute()
#14 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Shell.php(392): BakeShell->main()
#15 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/ShellDispatcher.php(200): Shell->runCommand(NULL, Array)
#16 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/ShellDispatcher.php(68): ShellDispatcher->dispatch()
#17 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/cake.php(50): ShellDispatcher::run(Array)
#18 {main}
Its very cryptic, if someone can tell me where to look, that would be great. I'm using the latest and greatest build of cake (2.3.5)
Thanks
Ah. CakePHP 2 is rubbish.. CakePHP 1.3 is a lot better, seems to work and does not use stupid capital letters on the folder structures.
I ran into the same problem and spent 2 hours debugging it. You seem to have made the exact same mistake I made.
CakePHP 2's model construction works by calling its model instances through \ReflectionClass. However, CakePHP 2 doesn't use namespaces.
What happens here is the following:
CakePHP 2 already has a class called ProjectTask in /lib/Cake/Console/Command/Task/ProjectTask.php. You named one of your models Projecttask, so when the ReflectionClass tries to call your Projecttask model, it accidentally calls Cake's internal ProjectTask shell task, which expects a stream parameter, but instead gets your model's class and alias parameter.
So basically, rename your Projecttask model to something else.
Also, namespaces are awesome.

Resources