Part of the EllisLab Network
   
3 of 32
3
v 1.2.2 grocery CRUD - an automatic Codeigniter CRUD
Posted: 18 April 2011 05:14 AM   [ Ignore ]   [ # 21 ]  
Summer Student
Total Posts:  30
Joined  11-27-2010

The error still there.

Look into error, i see that :

In the application/models/ion_auth_model.php have this line :

$this->db->select(array(
                
$this->tables['users'].'.*',
                
$this->tables['groups'].'.name AS '$this->db->protect_identifiers('group'),
                
$this->tables['groups'].'.description AS '$this->db->protect_identifiers('group_description')
                   )); 

Don’t know why the function protect_identifiers not work like normal, so

$this->db->protect_identifiers('group'

output : group and this is reserver word for mysql.

That’s very strange. I’ve also posted this issue on the IonAuth thread to see if Ben have

any suggestion.

Cheers.

Profile
 
 
Posted: 18 April 2011 05:44 AM   [ Ignore ]   [ # 22 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  229
Joined  12-18-2010
tieungao - 18 April 2011 09:14 AM

The error still there.

Look into error, i see that :

In the application/models/ion_auth_model.php have this line :

$this->db->select(array(
                
$this->tables['users'].'.*',
                
$this->tables['groups'].'.name AS '$this->db->protect_identifiers('group'),
                
$this->tables['groups'].'.description AS '$this->db->protect_identifiers('group_description')
                   )); 

Don’t know why the function protect_identifiers not work like normal, so

$this->db->protect_identifiers('group'

output : group and this is reserver word for mysql.

That’s very strange. I’ve also posted this issue on the IonAuth thread to see if Ben have

any suggestion.

Cheers.

I think I found what the error is. Codeigniter active record automatically uses protect_identifiers so to your select is used two times! try to do this I think it will solve your problem.

$this->db->select(array(
                
$this->tables['users'].'.*',
                
$this->tables['groups'].'.name AS ''group',
                
$this->tables['groups'].'.description AS ''group_description'
                   
)); 

And is secure there is not problem in this.

 Signature 

- grocery CRUD - a codeigniter CRUD library - user guide and download
- grocery CRUD - thread from forum

Profile
 
 
Posted: 18 April 2011 07:57 AM   [ Ignore ]   [ # 23 ]  
Summer Student
Total Posts:  30
Joined  11-27-2010

when i change to :

$this->tables['groups'].'.name AS  `group`'

This work like charm!

Thanks for your suggestion but im scare abit of change orgin IonAuth Code.

Btw, is anyway to deal with upload images and store filename at database?

Should i use callback_before_insert?

Profile
 
 
Posted: 18 April 2011 08:05 AM   [ Ignore ]   [ # 24 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  229
Joined  12-18-2010
tieungao - 18 April 2011 11:57 AM

when i change to :

$this->tables['groups'].'.name AS  `group`'

This work like charm!

Thanks for your suggestion but im scare abit of change orgin IonAuth Code.

Btw, is anyway to deal with upload images and store filename at database?

Should i use callback_before_insert?

Is on the future features. You can see many things that I will fix in the future by clicking to the link below :

Future features of grocery CRUD.

It’s a little bit complicated even to explain for how to do it. It’s not only the callback_before_add is the callback_field and you must change the form to multitype… etc etc. If you are a little bit patient I will inform you when I will added the uploading file. Thank you for you suggestions and I am glad to help you grin

 Signature 

- grocery CRUD - a codeigniter CRUD library - user guide and download
- grocery CRUD - thread from forum

Profile
 
 
Posted: 18 April 2011 08:08 AM   [ Ignore ]   [ # 25 ]  
Summer Student
Total Posts:  30
Joined  11-27-2010

Okie thank you so much!

Hope to hear any news about this powerful tool.

Profile
 
 
Posted: 18 April 2011 09:37 PM   [ Ignore ]   [ # 26 ]  
Grad Student
Avatar
Rank
Total Posts:  48
Joined  07-14-2007
web-johnny - 17 April 2011 10:51 PM

I create a new version of grocery CRUD v.1.0.1 for codeigniter 2.0.x . Actually this was a bug of codeigniter 2.0.2 (because I cannot include a config folder as module). But because we just need to do our job and keep going I create another way for the config files. The new version you will find it at google code hosting by clicking the below link

grocery CRUD version 1.0.1 for codeigniter 2.0.x

If you want just update your older files (from grocery CRUD v.1.0.0 to v.1.0.1) , just replace your old files with the new ones.

Hey… that’s cool! So I see that in order to fix it you moved all config files to application/config?
I spent some time myself trying to figure out what the problem was and I guess it is indeed a bug with 2.0.2 / Reactor!

If you edit system/core/Config.php around line 110/113 from

if ($found === FALSE)
{
    
continue;

.. to…

if ($found === FALSE)
{
    
continue;
}
else
{
    $found 
FALSE;

... it seems to solve it completely for v1.0.

I do not completely understand why those inner/outer loops are required in Config.php… but it just seems someone forgot to reset that $found var when exiting the inner loop… to prevent false positives from triggering the not found error. Maybe someone else can shed some light on this?

Have you submitted this error/request to Reactor codebase?

 Signature 

feedbleed.com - Saving music… one download at a time.
mmmmail.com - Disposable Email to RSS service.

Profile
 
 
Posted: 19 April 2011 01:47 AM   [ Ignore ]   [ # 27 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  229
Joined  12-18-2010

Actually I totally knew that was a codeigniter error . To all my friends programmers I advise them NOT to use 2.0.2 . It has other bugs to do with security libraries. Though many people just download the latest stable(!!) version so they need a library just to work fine with their codeigniter.I didn’t do anything to report it,  because at first I freak out why a so simple thing in my CRUD don’t play .  That’s why I created the new version . Hope that codeigniter 2.0.3 will be more stable .

Actually as you find where the error was , you can report it as an error and recommend your code.It will be good to report it.

 Signature 

- grocery CRUD - a codeigniter CRUD library - user guide and download
- grocery CRUD - thread from forum

Profile
 
 
Posted: 19 April 2011 02:56 AM   [ Ignore ]   [ # 28 ]  
Grad Student
Avatar
Rank
Total Posts:  48
Joined  07-14-2007

It seems it has been reported already… so let’s hope a merge happens soon.

https://bitbucket.org/ellislab/codeigniter-reactor/issue/200/environment-changes-break-config-with

If you know of other unreported bugs please report them!
Thank you.

 Signature 

feedbleed.com - Saving music… one download at a time.
mmmmail.com - Disposable Email to RSS service.

Profile
 
 
Posted: 19 April 2011 04:15 PM   [ Ignore ]   [ # 29 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  229
Joined  12-18-2010

Thanks to report it.
I think the most bugs has been reported. So I wish to a new version. I use packages a lot and I want to include my libraries/models and configs to a separate folder.

 Signature 

- grocery CRUD - a codeigniter CRUD library - user guide and download
- grocery CRUD - thread from forum

Profile
 
 
Posted: 19 April 2011 09:32 PM   [ Ignore ]   [ # 30 ]  
Summer Student
Total Posts:  10
Joined  01-13-2010

looks great Thanks

Profile
 
 
   
3 of 32
3