in-line edit issue

edited July 2015 in Bug Reports
Short form as described in the user guide will generate incorrect code unless the table name and the model name are the same...

$news = fuel_model('news_items',array ('where'=>"release_date <= '".$today."' and drop_date >= '".$today."'", 'order'=>'priority_order asc, release_date desc')); . . $n = 0; foreach($news as $item) : $n++; . . <?=fuel_edit($item)?> <?=fuel_edit($item->id, 'Edit News Item', 'news_items');?> . . endforeach;

for record 156, these do not generate comparable code -- see below

<span class="__fuel_marker__" data-href="http://localhost/fuel/fnps_news/inline_edit/" data-rel="156" title="Edit: " data-module="fnps_news" data-published="1"></span> <span class="__fuel_marker__" data-href="http://localhost/fuel/news_items/inline_edit/" data-rel="156" title="Edit News Item" data-module="news_items" data-published="1"></span><div class="news_item">

The short form shoved in the table name instead of the model name. It generates generates a 404 error. The long form works. The short form would appear to work only if the model name and the table name are the same.

At a minimum, the documentation should provide this as a warning about usage

Comments

  • edited 6:32PM
    If you change line 464 to the following and then comment out the rest, does it work for your scenario:
    $module = $id->parent_model(); //$tables = array_flip($id->parent_model()->tables()); //if (isset($tables[$module])) //{ // $module = $tables[$module]; //} //unset($tables);
Sign In or Register to comment.