thyseus / yii-user-management

a user management module collection for the yii framework
185 stars 122 forks source link

Declaration of YumTranslationController::performAjaxValidation() should be compatible with that of YumController::performAjaxValidation() #89

Closed mandavister closed 11 years ago

mandavister commented 11 years ago

When trying to access index.php?r=user/translation/admin I get the above mentioned error message

Slivicon commented 11 years ago

I see this message as well. Working around this issue displayed a second, similar error but for YumTranslationController::loadModel().

Here is a possible workaround until the issue is fixed in the repo:

--- git/protected/modules/user/controllers/YumTranslationController.php 2013-02-20 15:59:10.685846597 -0500
+++ modified/protected/modules/user/controllers/YumTranslationController.php    2013-02-21 09:31:57.378551195 -0500
@@ -30,7 +30,7 @@
        {
                $models = array();
                foreach(Yum::getAvailableLanguages() as $language) {
-                       $models[] = $this->loadModel($category, $message, $language);
+                      //workaround for error YumTranslationController::loadModel should be compatible with YumController::loadModel
+                       $models[] = $this->loadTranslationModel($category, $message, $language);
                }

                if(isset($_POST['YumTranslation'])) {
@@ -100,7 +100,7 @@
                                        ));
        }

-       public function loadModel($category, $message, $language = null)
+       //workaround for error YumTranslationController::loadModel should be compatible with YumController::loadModel
+       public function loadTranslationModel($category, $message, $language = null)
        {
                $model=YumTranslation::model()->find('category = :category and message = :message and language = :language', array(
                                        ':category' => $category,
@@ -117,9 +117,9 @@
                return $model;
        }

-       protected function performAjaxValidation($model)
+       //workaround for error YumTranslationController::performAjaxValidation should be compatible with YumController::performAjaxValidation
+       protected function performAjaxValidation($model, $form = 'translation-form')
        {
-               if(isset($_POST['ajax']) && $_POST['ajax']==='translation-form')
+               if(isset($_POST['ajax']) && $_POST['ajax']===$form)
                {
                        echo CActiveForm::validate($model);
                        Yii::app()->end();
thyseus commented 11 years ago

fixed in 2550f35 . Sorry for taking so long to fix this serious bug...

AMilkov commented 10 years ago

@thyseus This bug is still present in the current master! I guess it get resurrected somehow ....