⚠ 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. ⚠


web-johnny

Member Since 13 Oct 2011
Offline Last Active Sep 23 2021 11:22 AM
****-

Posts I've Made

In Topic: Try to "CRUD" from a view

10 April 2021 - 07:48 AM

I am using GC Enterprise und want to crud from a view. I did put the primary key and the table has correctly loaded. But when I click on read a row, it appears this error We can't process the response of the server. This is all we know about it:

Summary: 500 - Internal Server Error

Error: error

Response:

 

Hello @majd94,

 

This is a very generic error and it can be anything really  :)

I have created a YouTube video for that to see how to debug it https://youtu.be/X0gnDD0qTS8 Although this is for Grocery CRUD community edition you can follow the same steps for Grocery CRUD Enterprise as well.

 

Let me know if that helped.

 

Regards

Johnny


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

16 March 2021 - 02:48 PM

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

 

 

 

 

 

 

 

 

Hello @fede72bari,

 

1. If $this->grocery_crud-> is the way that it works for you then that's fine keep it  :) 
2. For the issue that you have please have in mind that a custom error message was introduced on Grocery CRUD Enterprise, so if you would like to have a custom error message this is only available for Grocery CRUD Enterprise. For example see the example here: https://new.groceryc...k-before-insert . However if you are looking for a work-around go to step 3  :) 
3. If I had to blindly guess then I think that the issue is that you are having the line:

$this->form_validation->set_message('_check_not_existing', 'This product has been already linked to the selected vendor with an existing vendor offer.');

 

inside of the callback. Try to add that at the very beginning (even before grocery_crud initial load). If this still will not work, then I have a hacky way for you, try to add your custom message here:

https://github.com/s..._CRUD.php#L5474

 

for example:
 

$ci = &get_instance();
$ci->load->library('Form_validation');
$ci->form_validation->set_message('_check_not_existing', 'This product has been already linked to the selected vendor with an existing vendor offer.');

....

Let me know if any of the above worked.

 

 


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

16 March 2021 - 06:38 AM

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

 

Hello @fede72bari,

 

From your question it seems that you are referring to Codeigniter version 3 and Grocery CRUD version 1. Now from the code that you've sent I am seeing some mistakes:

1. Instead of using: $this->grocery_crud->getState() == 'insert' use the object of your CRUD, for example: $crud->getState() === 'insert'
2. The error Uncaught TypeError: $(...).tooltip is not a function is not an issue with Grocery CRUD it self. It is mainly because there are conflicting versions of jQuery. Use the unset_jquery() function $crud->unset_jquery(); and also checkout the video for common grocery CRUD mistakes:  https://youtu.be/X0gnDD0qTS8
3. For your initial issue, although I am not sure if this will work, have you tried using the "is_unique" set rule? For example in your case something like this: 

$crud->set_rules('vendors_id','Vendors ID','is_unique[vendors_offers.vendors_id]'); 
if this still doesn't work and you would like to use the callback then I can't find any obvious mistake on your code, if I had to blindly guess it is probably because of the JavaScript error. In order to debug it more, checkout the video tutorial at the second answer.

Regards

Johnny


In Topic: Can't Install Grocery CRUD Entreprise with PHP 8.0

21 February 2021 - 08:17 PM

Hello

 

When i try to install Grocery CRUD entreprise with PHP 8.0, i have this error :

 

our requirements could not be resolved to an installable set of packages.
 
  Problem 1
    - scoumbourdis/phpexcel[1.9.0, ..., 1.9.x-dev] require php ^5.4|^7.0 -> your php version (8.0.1) does not satisfy that requirement.
    - grocerycrud/enterprise 2.8.7 requires scoumbourdis/phpexcel ^1.9 -> satisfiable by scoumbourdis/phpexcel[1.9.0, 1.9.1, 1.9.x-dev].
    - Root composer.json requires grocerycrud/enterprise 2.*.* -> satisfiable by grocerycrud/enterprise[2.8.7].
 

 

scoumbourdis/phpexcel require PHP 5 or 7 but my production env are in PHP8

 

Can you help please ?

 

Hello @NMed,

 

I've updated the composer dependencies. If you try again to install it without any changes it should work. If you are still having issues, try to remove the composer.lock file and try again.

 

Regards
Johnny


In Topic: Can't Install Grocery CRUD Entreprise with PHP 8.0

20 February 2021 - 12:37 PM

Hello NMed,

 

I will have it a look and let you know. I will probably create a new version that will also support PHP 8

 

Regards

Johnny

 



Hello

 

When i try to install Grocery CRUD entreprise with PHP 8.0, i have this error :

 

our requirements could not be resolved to an installable set of packages.
 
  Problem 1
    - scoumbourdis/phpexcel[1.9.0, ..., 1.9.x-dev] require php ^5.4|^7.0 -> your php version (8.0.1) does not satisfy that requirement.
    - grocerycrud/enterprise 2.8.7 requires scoumbourdis/phpexcel ^1.9 -> satisfiable by scoumbourdis/phpexcel[1.9.0, 1.9.1, 1.9.x-dev].
    - Root composer.json requires grocerycrud/enterprise 2.*.* -> satisfiable by grocerycrud/enterprise[2.8.7].
 

 

scoumbourdis/phpexcel require PHP 5 or 7 but my production env are in PHP8

 

Can you help please ?