Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorJCC
     
    Hi there,

    I have an innocuous controller called ModelController and when posting data to it I get this weird error:

    Warning: preg_match() expects parameter 2 to be string, array given in ~\akelos\trunk\lib\AkRequest.php on line 225

    Notice: Array to string conversion in ~\akelos\trunk\lib\AkRequest.php on line 713

    Fatal error: Could not find the file /app/controllers/module_controller.php for the controller Array_ModuleController in ~\akelos\trunk\lib\AkRequest.php on line 733

    There is no special code in the edit action - could the name be reserved (all the other controllers work just fine)

    Thanks,

    John

    (Version used is from SVN: Revision 851)
    •  
      CommentAuthorbermi
     

    Hi John, it should not be reserved, although it is used by Akelos internally to decide which models it should automatically load when instantiating the controller.

    Next month I start coding a modeling site so this will become a problem for me as well. I fixed it on my local copy, but still need to test it before committing it into the trunk.

    Here is the un-unit-tested patch

    Index: lib/AkActionController.php
    ===================================================================
    --- lib/AkActionController.php  (revision 1060)
    +++ lib/AkActionController.php  (working copy)
    @@ -393,6 +393,8 @@
    
             $models = array_unique(array_merge(Ak::import($this->model), Ak::import($this->models), Ak::import($models), (empty($this->app_models)?array(): Ak::import($this->app_models))));
    
    +        unset($this->model, $this->models);
    +                
             foreach ($models as $model){
                 $this->instantiateModelClass($model, (empty($this->finder_options[$model])?array():$this->finder_options[$model]));
             }
    
    • CommentAuthorJCC
     
    Hi Bermi,

    I applied the patch to my SVN repository (revision 851) and it didn't seem to fix it. So I have upgraded to revision 1140 (current) and I see the patch has already been applied. However I'm still getting the same error message - do you have any suggestions?

    Kind regards,

    John