⚠ In case you've missed it we are migrating to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This forum is read-only and soon will be archived. ⚠


fede72bari

Member Since 24 Mar 2020
Offline Last Active Mar 22 2021 09:27 AM
-----

Posts I've Made

In Topic: Cstome Error Message On set_rule callback does NOT appear

17 March 2021 - 04:31 PM

Dear Johnny,

 

could be possible as an alternative that avoid to modify the source code of GC library to use the existing DIV "id=report-error" sending as response before die the desired message? It is the field for erro message just above the "save an go back to list" button in the insert form page. If this is possible, how is it codify that response? Any Json format?

 

thanks


In Topic: Cstome Error Message On set_rule callback does NOT appear

16 March 2021 - 04:33 PM

Dear Johnny,

 

I tried to move it in several positions even before

 

        $crud = new grocery_CRUD();
        $this->grocery_crud->set_theme('bootstrap-v4');  //flexigrid     
        
        $this->grocery_crud->set_table('vendors_offers');

 

and others before the final rendering function, but no-way it seems that GC overwrite that linking of the error message with the relative callback failure.

 

Was your other workaround acting on the source code of GC library? I had already fixed some bugs and reported on github; bugs that i don't know if they have been accepted. The more I touch the worse will be the mess in case of updating need. No other ways?

 

Thanks.

 

f


In Topic: Cstome Error Message On set_rule callback does NOT appear

16 March 2021 - 09:35 AM

Dear Johnny,

 

you are right Codeigniter 3 and Grocery Crud 1. I have to say this

 

- I have not bugs or mistakes, the code run correctly. The "$this->grocery_crud->getState() == 'insert'" works perfectly. "$crud->" never worked in my environment, just "$this->grocery_crud->" for every GC function. One year ago I found that many others had the same trouble, no explanations found, just one post of a person who tried in this way and it worked. So since all development in my environment worked in this way I assume that the problem is not that one. "$this->grocery_crud->getState()" returns the proper state with no errors.

 

- the control must be custom since I have to check that 2 fields in a linking (n-n relation) table are not present and no one of these fieds are the primary key of the linking table.

 

- the problem is just the message in the alert box. In case the callback gave false result I desire that the alert box message is explacative of the failure reason: "This product has been already linked to the selected vendor with an existing vendor offer." I tried to follow examples and some posts suggestion, and so

 

- defined the callback "$this->grocery_crud->set_rules('vendors_id','Vendors ID','callback__check_not_existing'); " that is working

 

- defined the function _check_not_existing, that is working

 

- defined the custom message "$this->form_validation->set_message('_check_not_existing', 'This product has been already linked to the selected vendor with an existing vendor offer.');" that actually is not working as desired, but still no error or bug appears, since a standard and generic message is appearing.

 

According to your experience is there something i mixed up or forgotten or it is a not detected conflict of GC with CI? Thank you.

 

f

 

 

 

 

 

 

 

 


In Topic: Cstome Error Message On set_rule callback does NOT appear

15 March 2021 - 09:43 PM

still fighting with this trouble, anybody has any idea? thanks.


In Topic: Cstome Error Message On set_rule callback does NOT appear

09 March 2021 - 08:38 AM

Nobody has an idea for fixing this issue? ^_^