Welcome Guest, Not a member yet? Register   Sign In
v 1.3.3 grocery CRUD - an automatic Codeigniter CRUD
#21

[eluser]web-johnny[/eluser]
[quote author="tieungao" date="1303132741"]Thanks so much for your support!

I do like your instruction and this work!

Btw, have 2 litle issues :

1. Need to change to

Code:
$this->load->view('application/views/includes/header',array('css' => $css, 'js' => $js));

in order this working at custom_cms/template.php. Don't know why :down:


2. When i enable some function with IonAuth at include header :

Code:
Hello <a href="">&lt;?php  echo $this->ion_auth->get_user()->username;  ?&gt;</a>

this given error :

Code:
A Database Error Occurred

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group, groups.description AS group_description, meta.fullname, meta.cmnd, meta.p' at line 1

SELECT users.*, groups.name AS group, groups.description AS group_description, meta.fullname, meta.cmnd, meta.phone FROM (users) LEFT JOIN meta ON users.id = meta.user_id LEFT JOIN groups ON users.group_id = groups.id WHERE `users`.`id` = '1' LIMIT 1

Filename: D:\wamp\www\crud\system\database\DB_driver.php

Line Number: 330

Notice that function work ok on other page not using CRUD.


I think have something conflict around here.


Thanks again for your help.[/quote]

It's really really strange error.

For the first one (application/views/....) since it works that's matters :-) It was just a quick way to do it .
For the second : its really really strange. Try to do this :

Code:
&lt;?php $ci = & get_instance(); ?&gt;
Hello <a href="">&lt;?php  echo $ci->ion_auth->get_user()->username;  ?&gt;</a>
Perhaps this works.
#22

[eluser]tieungao[/eluser]
The error still there.

Look into error, i see that :

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

Code:
$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

Code:
$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.
#23

[eluser]web-johnny[/eluser]
[quote author="tieungao" date="1303136089"]The error still there.

Look into error, i see that :

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

Code:
$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

Code:
$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.[/quote]

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.

Code:
$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.
#24

[eluser]tieungao[/eluser]
when i change to :

Code:
$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?
#25

[eluser]web-johnny[/eluser]
[quote author="tieungao" date="1303145864"]when i change to :

Code:
$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?[/quote]

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 :-)
#26

[eluser]tieungao[/eluser]
Okie thank you so much!

Hope to hear any news about this powerful tool.
#27

[eluser]deadelvis[/eluser]
[quote author="web-johnny" date="1303098705"]
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.[/quote]

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
Code:
if ($found === FALSE)
{
    continue;
}
.. to...
Code:
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?
#28

[eluser]web-johnny[/eluser]
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.
#29

[eluser]deadelvis[/eluser]
It seems it has been reported already... so let's hope a merge happens soon.

https://bitbucket.org/ellislab/codeignit...onfig-with

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

[eluser]web-johnny[/eluser]
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.




Theme © iAndrew 2016 - Forum software by © MyBB