⚠ In case you've missed it we have migrated 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. ⚠


juliette

Member Since 30 Oct 2013
Offline Last Active Mar 21 2014 02:50 PM
-----

Posts I've Made

In Topic: set_relation breaks processing of field with same name returned

08 January 2014 - 08:56 AM

Hello,

 

i also had similar problem and the thing is that internaly name of this fields are encoded // so i just use this function (copied form grocery model)
 

    function unique_field_name($field_name) {
	    return 's'.substr(md5($field_name),0,8); //This s is because is better for a string to begin with a letter and not with a number
    }
ant then

		    $crud->callback_column($this->unique_field_name('vrsta_id'),array($this,'valueToEuro'));
		    $crud->set_relation('vrsta_id','vrsta','{vrsta_id}');
and works fine // i know its not optimal but it works :)

 

 

This works fine for callback_column, but not for callback_field ... Any idea?

 

UPDATE :

Moreover, it breaks the search function: when using the callback_column with $this->unique_field_name and filtering the list, the change_list() function encounters problem here :

if( $has_callbacks && isset($this->callback_column[$field_name]) )
	$list[$num_row]->$field_name = call_user_func($this->callback_column[$field_name], $field_value, $row);
// => echo $list[$num_row]->$field_name fails

I didn't find how to solve it ..

 

Juliette


In Topic: Image CRUD - FineUploader error and 404 error

07 January 2014 - 09:48 AM

Hello,

Now this is OK. There were several problems:

 

1/ The different URLs were not found because they were wrong: a segment was missing due to the fact that I work in subfolders. I solved the problem by looking at this: https://github.com/s...e-crud/issues/6

In libraries/image_crud.php I modified getState() and _get_delete_url().

 

In getState():

$rsegments_array = $this->ci->uri->rsegment_array();

/* Added part */
$segments_array = $this->ci->uri->segment_array();
$diff_uri = count($segments_array) - count($rsegments_array); 
if($diff_uri)
{
	$add_uri_array = array();
	for($i = 1; $i <= $diff_uri; $i++) $add_uri_array[$i] = $segments_array[$i];
	$add_uri = implode('/',  $add_uri_array);
	$add_uri .= '/';
} else $add_uri = '';
/* End of added part */

And in the rest of the function, I added $add_uri in all site_url(), for example:

$upload_url = site_url($add_uri.$rsegments_array[1].'/'.$rsegments_array[2].'/upload_file/'.$rsegments_array[3]);

I did the same in _get_delete_url().

 

2/ Then I encountered several issues to upload a file:

- I had a NOT NULL field in my table, and it caused an error at the insertion of the file_name in the table.

- if my primary key is not an auto-increment field, the insert statement also fails.

 

3/ 2 notices that are not in the documentation and seem important:

- the ordering field has to be numeric. I thought that it could be a character field depending on which images would be sorted.

- the relation field has to be numeric. I did not find yet how to modify the code so that character fields could be accepted. And it seems that a category should be provided in the URL otherwise it fails.

 

Finally, if the table contains other fields of description, they can neither be read nor edited, this would be great to able to do that! ;)

 

Juliette
 


In Topic: Image CRUD - FineUploader error and 404 error

27 December 2013 - 11:24 AM

Hello,

 

Actually all URLs can't be found: upload_file, insert_title, delete_file, ordering (ordering url can't be found but images can be moved ..), ajax_list ..

 

For example, when I try to delete a file I get this error:

"NetworkError: 404 Not Found - http://localhost/osu...1/delete_file/3"

But if I enter this URL in the browser, it "works" and the corresponding image is deleted, as well as the record in the table.

 

I keep on searching the problem ..


In Topic: Image CRUD - FineUploader error and 404 error

17 December 2013 - 09:01 AM

Hello Johnny and thanks for your reply,

 

I installed Image CRUD again, and I encounter the same error.

Here is my source code (I let the whole page).

 

You can see that the jquery files are not the same as in Image CRUD : I use jquery-1.7.2.min.js and jquery-ui-1.8.18.custom.min.js. (actually I implemented the Grocery CRUD unset_jquery() and unset_jquery_ui() methods in Image CRUD.)

I tried with the image CRUD version of these files, but it didn't change anything ...

 

Juliette