- Issue created by @vinodjethwani
The "Too few arguments" error when enabling the ajax_comments module indicates it's trying to use Drupal core's CommentForm constructor with an insufficient number of arguments, likely due to incompatibility with your Drupal core version. The best solutions are to update the ajax_comments module to a compatible release or to patch its code (AjaxCommentsForm.php) to pass the correct number and type of arguments cat language translator to the core CommentForm constructor by injecting the necessary services. As a temporary fix, disabling the ajax_comments module will resolve the fatal error. Always check module compatibility with your Drupal core version and back up your site before making changes.
The error "Too few arguments to function Drupal\comment\CommentForm::__construct()" indicates that the ajax_comments module is attempting to call a core Drupal comment form constructor with 6 arguments, but your current Drupal core version expects 8. This is a compatibility issue, likely due to an outdated ajax_comments module or a recent Drupal core upgrade. To fix it, you need to update the ajax_comments module to a version that is compatible with your Drupal core (e.g., using composer require drupal/ajax_comments:^x.y) and then clear your caches. If no compatible MyKFCExperience Survey version exists, consider an alternative module or contributing to the ajax_comments project.
This error message means that the constructor for the CommentForm class in Drupal expects 8 arguments, but the Ajax Comments module is only passing 6 arguments when it calls the constructor. This usually happens when a contrib module is outdated compared to the core Drupal version. Check if there's an updated ajax_comments module version compatible with your Drupal core version. Go to the line mentioned (line 83) where CommentForm::__construct() is called and adjust the number of arguments. Find the new arguments that were added. Pass the required 8 arguments instead of 6 hctra org In your AjaxCommentsForm class, inject the new services (form_builder and event_dispatcher) through the constructor and the service container.
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
avpaderno โ made their first commit to this issueโs fork.