ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

v 1.3.3 grocery CRUD - an automatic Codeigniter CRUD

April 11, 2011 3:24am

Subscribe [77]
  • #76 / May 12, 2011 3:22pm

    web-johnny

    235 posts

    You didnt’ insert the set_table . Please read the installation for codeigniter first. You can add the example database to test if it works and you have to run the controller examples .

  • #77 / May 21, 2011 10:01am

    web-johnny

    235 posts

    grocery CRUD is now on his own domain : http://www.grocerycrud.com

  • #78 / May 21, 2011 11:37am

    darrentaytay

    100 posts

    Good work mate, really nice piece of kit.

  • #79 / May 23, 2011 3:49pm

    web-johnny

    235 posts

    Thanks I really appreciate it.

  • #80 / May 28, 2011 1:05pm

    timj

    80 posts

    Hello, I’ve asked this question of the developer by email and the answer I received made no sense to me, so I am sending it to a wider list in the hopes someone can explain this to me.

    I want to build a few callbacks that build a query thus: ‘SELECT from database WHERE client_id = $uri->segment(3)’;

    If I do this:

    $crud->set_table('orders');
    $crud->where('client_id = 1');

    I get a list of records in the orders table that are related only to client_id 1, so I know this product can work. This is exactly what I want, except with ‘1’ as a variable. When I offer a variable, this product tells me it doesn’t know what to do with the data.

    I was offered this as a possible solution:

    function manage_orders($state = 'list', $id)
    {
        if( ($state == 'list' || $state == 'ajax_list') )
        {
            $session = $this->session->userdata("client_id");
            if(!empty($id))
            {
                $this->session->set_userdata(array("client_id" => $id));
            }
            elseif(empty($id) && !empty($session))
            {
                $id = $session;
            }
            if(!empty($id))
                $this->grocery_crud->where('client_id',$id);
            }
    ...
    }

    However, this “solution” throws a lot of errors and doesn’t produce a variable this product can understand:

    Fatal error: Uncaught exception ‘Exception’ with message ‘The state is unknown , I don’t know what I will do with your data!’ in /home/public_html/application/third_party/grocery_crud/libraries/grocery_crud.php:2398 Stack trace: #0 /home/public_html/application/controllers/test.php(105): grocery_CRUD->render() #1 /home/public_html/system/core/CodeIgniter.php(339): Test->manage_orders(‘2’) #2 /home/public_html/index.php(201): require_once(’/home/...’) #3 {main} thrown in /home/public_html/application/third_party/grocery_crud/libraries/grocery_crud.php on line 2398

    It seems to me the thing I want to do is what EVERY PERSON who uses this product at any length would ultimately want to do, quickly build nested CRUD tables.

    If someone can help me I’d appreciate it. And I would suggest that this simple functionality be built in as an option in future releases.

  • #81 / Jun 04, 2011 7:00am

    zietBukuel

    2 posts

    First, I wanna say a big THANK YOU for this wonderful project, it’s very useful.

    Second I’m having problems with the Text Editor, it seems that when I change a text to Red, when I save it it will change back to black anything that’s added to a tag like class=”” id=”” etc will get removed. Do you know how to fix this? or maybe just switch to another Text Editor.

    Thank you.

  • #82 / Jun 08, 2011 12:03am

    web-johnny

    235 posts

    First, I wanna say a big THANK YOU for this wonderful project, it’s very useful.

    Second I’m having problems with the Text Editor, it seems that when I change a text to Red, when I save it it will change back to black anything that’s added to a tag like class=”” id=”” etc will get removed. Do you know how to fix this? or maybe just switch to another Text Editor.

    Thank you.

    I see your problem but I don’t understand !! Mine works fine . i add color, class, id and everything works fine. Perhaps there is other problem (some tags that doesn’t close) . I don’t know , this editor is quite a very good one and you don’t need to change it.

  • #83 / Jun 08, 2011 2:51am

    zietBukuel

    2 posts

    The editor isn’t working for me, I’m using the latest versions of Chrome and Firefox, but the custom styles aren’t saved, they are striped.

    How can I replace the editor?

  • #84 / Jun 08, 2011 3:39am

    osci

    377 posts

    in 2.0.2 in system/core/security.php

    $evil_attributes = array('on\w*', 'style', 'xmlns');

    This removes the style attributes.

    Check GLOBAL XSS FILTERING on 2.0.2 and CKEDITOR

  • #85 / Jun 08, 2011 6:42pm

    hardCoded

    1 posts

    This CRUD looked really great… at first.
    Here are some issues I ran in to:

    - Overly complicated MY_loader and MY_output files that make integration with existing sites too complicated. Why didn’t you just include style and file include instructions instead of writing a custom output?

    - Loading a table doesn’t use active record syntax but it’s own and a couple functions of which I found on the site (and posted comments on), didn’t even work.

    - Config file lets you set the directory for the theme files, but then the paths to the css and js files are hard coded in the library files which messes everything up.

    - Pagination didn’t work for me (even though it’s set in the config)... so Grocery crud loads EVERY row in my database at once, crashing my browser

    - Much more, but tired of writing

    Not trying to be a jerk, but this was a horrible experience.  I’ve decided to move on and leave grocery crud behind on this project, but I thought I would just let you know so you can sort these things out for others.

  • #86 / Jun 09, 2011 6:41pm

    web-johnny

    235 posts

    This CRUD looked really great… at first.
    Here are some issues I ran in to:

    - Overly complicated MY_loader and MY_output files that make integration with existing sites too complicated. Why didn’t you just include style and file include instructions instead of writing a custom output?

    - Loading a table doesn’t use active record syntax but it’s own and a couple functions of which I found on the site (and posted comments on), didn’t even work.

    - Config file lets you set the directory for the theme files, but then the paths to the css and js files are hard coded in the library files which messes everything up.

    - Pagination didn’t work for me (even though it’s set in the config)... so Grocery crud loads EVERY row in my database at once, crashing my browser

    - Much more, but tired of writing

    Not trying to be a jerk, but this was a horrible experience.  I’ve decided to move on and leave grocery crud behind on this project, but I thought I would just let you know so you can sort these things out for others.

    I just updated the installation for NOT use the template controller . its on http://www.grocerycrud.com/crud/view/codeigniter_installation . The most of your issues was because of the understanding of template layout. The active record is used for the 95% of the model. You can see it at the model of grocery crud. I just use in few case SHOW COLUMNS in some cases to take the “mode” of my field (is it textarea? , is it input? , is it numeric? etc). I don’t think this is a problem. You can try grocery crud from the beggining . Download the latest version of CI and then add the files of grocery , you will see that everything works fine. Then you can add your own views etc etc.

    I did the two core libraries mainly because I work with those libraries. It has sections and many other things and I will documented in the future.
    Second I did the my_loader and my_output it was that I wanted to have less code . I’m writing lot of tables in my job and I know that even 10 lines of code in each function will be harmful for me in the future. Anyway thats a sugggestion to use template. That’s why I add those instruction for those that don’t want to use my loader and my output.

    If you see the installation with those instructions to use your own view (without deleting my_Output and my_loader), you will see that its more easy to add grocery crud.

    If you see , that it works and see the power of writing less and think more, you will see that it worth it. It will also encourage you to continue using it 😊

  • #87 / Jun 13, 2011 4:39pm

    timj

    80 posts

    The latest version solved my problems with uri segmenting. It is now possible to build nested CRUD tables. Thanks!

  • #88 / Jun 13, 2011 5:27pm

    a/\ekc

    6 posts

    Looks very nice, but some little bugs
    If I use not empty $config[‘url_suffix’], then buttons “edit” and “delete” have incorrect urls, because suffix goes before ID number (something like .../edit_suffix/43)

    When I use flexgrid as template there is incorrect unicode text display after sort
    before sort Vezetéknév:
    after sort VezetГ©knГ©v:
    When datatables is used as template no mistakes

    And
    “If you although don’t want to use the template controller just follow the below steps” (from installation instruction) seems not works (but may be in my case only 😊)

  • #89 / Jun 14, 2011 12:23am

    web-johnny

    235 posts

    Looks very nice, but some little bugs
    If I use not empty $config[‘url_suffix’], then buttons “edit” and “delete” have incorrect urls, because suffix goes before ID number (something like .../edit_suffix/43)

    When I use flexgrid as template there is incorrect unicode text display after sort
    before sort Vezetéknév:
    after sort VezetГ©knГ©v:
    When datatables is used as template no mistakes

    And
    “If you although don’t want to use the template controller just follow the below steps” (from installation instruction) seems not works (but may be in my case only 😊)

    1. I actually didn’t tested with url suffix and you’re right. Maybe if you change the url_suffix at the top of grocey CRUD perhaps it works. Maybe if you try for example:

    function employees_management()
    {
        $this->config->set_item('url_suffix', '');
        $crud = new grocery_CRUD();
     
        $crud->set_theme('datatables');
        $crud->set_table('employees');
        $crud->display_as('officeCode','Office City');
        $crud->set_subject('Employee');
     
        $crud->set_relation('officeCode','offices','city');
     
        $crud->render();
    }

    will work for now on and I will change this code to the next version to work with url suffix.

    2. For the template controller , I forgot to write that though you MUST have the two libraries but you will not use them. Its easy you just have the two libraries and you use the default functionallity of codeigniter views. I have a poll and you can vote at : http://ellislab.com/forums/viewthread/191417/ that I collect answers if the users want by default the template controller. So to the next version I delete those two libraries.

    Thank you for your suggestions.

  • #90 / Jun 14, 2011 10:02pm

    fabgonber

    15 posts

    web-johnny,

    Grocery CRUD it’s a very good tool 😊 save me a lot of
    time ... congratulations…

    i really apreciate know the changelog of 1.0.4

    Regards

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases