⚠ 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 is an archived forum. ⚠

  •     

profile picture

longtext problem



mrtakdnz

mrtakdnz
  • profile picture
  • Member

Posted 27 July 2012 - 22:29 PM

Hi, i try to insert some data to textarea from excell. or html.
i add data from mysqladmin it works but if i add the data from grocery crud, it cuts the data from 8832'th character (includes blank)
i change to ckeditor, i try to unset texteditor but it didn't works.

i cannot find the way out. i'm so appreciated if you help me about this issue.

Here is the codes: http://pastebin.com/vAR0ETSG

thanks in advance...

noskov.biz

noskov.biz
  • profile picture
  • Member

Posted 28 July 2012 - 04:56 AM

Hi, mrtakdnz!

For what you are using _textarea() callback for the "content" field? It seems to me the problem might be there.

mrtakdnz

mrtakdnz
  • profile picture
  • Member

Posted 28 July 2012 - 07:45 AM

Hi noskov.biz,

No it's not. If i remove it or use unset_textarea('content') or change_field_type('content,'text') same problem continues.
_textarea callback is for use CKEditor instead of tinyMCE to my content fields.

This codes also gives same error: http://pastebin.com/JzJWqZFv

noskov.biz

noskov.biz
  • profile picture
  • Member

Posted 28 July 2012 - 07:58 AM

And what type of the field "content" in the db do you use. Is it "text" type?

mrtakdnz

mrtakdnz
  • profile picture
  • Member

Posted 28 July 2012 - 08:10 AM

no, longtext type. i have to use longtext type because of my client's long page contents.

mrtakdnz

mrtakdnz
  • profile picture
  • Member

Posted 28 July 2012 - 10:05 AM

any idea? it's kind of urgency :ph34r:

noskov.biz

noskov.biz
  • profile picture
  • Member

Posted 28 July 2012 - 12:10 PM

It's strange :huh: For me the similar code works well, no matter what texteditor I use. The one thing is just change the field type from 'longlext' to 'text', like this:

$crud->field_type('something', 'text');

and everything is ok.

Don't know... Please, post your function with the corresponding dump of db table.

And the last thing: when you return the data by calback function _textarea(), there are "name" and "id" which not correspond to name and id of grocery CRUD input field, cause of you use your own values.

mrtakdnz

mrtakdnz
  • profile picture
  • Member

Posted 28 July 2012 - 19:48 PM

Actually i disable the _textarea() function and use ->field_type('content','text') bu it didn't work eather. also i remove all callback functions and unset texteditor but it did'nt work eather.

is there any post limitation on unix servers? maybe?

DB and full codes: http://pastebin.com/gFShWmuh

noskov.biz

noskov.biz
  • profile picture
  • Member

Posted 28 July 2012 - 20:47 PM

Hi again, mrtakdnz!

I tried you code, it works: 'content' field with 'longtext' and $crud->field_type('content', 'text'); in the ckeditor or tinymce works well. Don't know :wacko:

I tried it in my local machine: Ubuntu 12.04 + XAMPP 1.7.7 + CodeIgniter 2.1.2 + grocery CRUD 1.2.3 (without .htaccess).

Please, try you code on the another local machine or server. It seems to me that the problem is not in grocery CRUD, maybe you are right about some post limitation.

mrtakdnz

mrtakdnz
  • profile picture
  • Member

Posted 28 July 2012 - 20:48 PM

ok, now i think i found something. in our language percentage is written like %70, not 70% system is cutting the text from "%70" string. bu i cannot find how! also i try to paste some text from excell.

noskov.biz

noskov.biz
  • profile picture
  • Member

Posted 28 July 2012 - 21:02 PM

And if you change the collation of the table is it works?

mrtakdnz

mrtakdnz
  • profile picture
  • Member

Posted 28 July 2012 - 21:11 PM

nope! actually if i copy original text from text editor and update it from PHPMyAdmin it works fine, but when i update it from codeigniter... puf...
maybe grocery crud is filtering the text like sprintf() function. i cannot find the exact line for this operation.

Here is the weird html which my clients try to insert: http://pastebin.com/NWTMMwtM

noskov.biz

noskov.biz
  • profile picture
  • Member

Posted 28 July 2012 - 21:24 PM

As I know grocery CRUD do not filtering the text. Hm, I can save your client example text from ckeditor. It's ok.

And what versions of CI and grocery CRUD do you use? And what says firebug? Is there any error?

mrtakdnz

mrtakdnz
  • profile picture
  • Member

Posted 29 July 2012 - 12:02 PM

CI v2.1.0 (i just update it to 2.1.2 but same)
GC v1.2.3
No firebug errors. nothing at all.

i just read all grocery crud codes but i didn't find anything at all. i'm going to lose my mind...

mrtakdnz

mrtakdnz
  • profile picture
  • Member

Posted 29 July 2012 - 12:41 PM

i just try this code to check it


$this->crud->callback_before_update(array($this,'_save_content'));


function _save_content($post_array,$primary_key) {

$idata = $post_array;
$idata['id'] = null;

$this->db->insert('guney_pages_shadow',$idata);

return $post_array;

}




same problem on shadow table.

mrtakdnz

mrtakdnz
  • profile picture
  • Member

Posted 29 July 2012 - 17:26 PM

I want to show you a funny thing that i realize.

Here is a screencast: http://screencast-o-matic.com/watch/cliUb6KDP

mrtakdnz

mrtakdnz
  • profile picture
  • Member

Posted 29 July 2012 - 22:10 PM

Solved: global_xss_filtering was seted to true.

Sorry about distrubution, and noskov.biz i'm so appreciated for your efforts. Thanks much.

noskov.biz

noskov.biz
  • profile picture
  • Member

Posted 30 July 2012 - 04:38 AM

Hahah :D there was xss filtering! I didn't guess. I have turned it off by default, so for me all you code was working. Well, I'm glad that now everything is ok.

You are welcome!