Problems with input formats

asb - April 27, 2008 - 19:30
Project:Table Manager
Version:HEAD
Component:Code
Category:bug report
Priority:critical
Assigned:pobster
Status:active
Description

Hi,

if input formats are enabled, Table Manager seems to do strange things to the data. Example: Default input format "PEAR Wiki filter" (= MediaWiki-like Wikitags); an URL is entered in a table as follows:

[http://drupal.org/drupal-5.5 Drupal 5.5]

This link works properly after entering into a Table Manager table (Example: http://www.kefk.org/webworking/drupal/chronologie)

However, this appears *not* to remain untouched; if editing this record at least once, you get output like this:

&lt;a href=&quot;<a href="http://drupal.org/drupal-5.5">http://drupal.org/drupal-5.5</a>&quot;&gt;Drupal 5.5&lt;/a&gt;

The record's contents seems to be expanded into plain HTML inside Table Manager and then re-inserted into the record.

I hope this description suffices to reproduce the behaviour.

Thanks & greetings, -asb

PS: It'd be nice if Table Manager would use CCK fields as field types ;-)

#1

pobster - April 27, 2008 - 22:04

Hmmm it's probably my passing the row contents back through check_markup when re-submitting rows... I guess... I'll look into it tomorrow...

Can you just let me know a couple of things though to help with re-producing this error;

  • Which input filter you're using?
  • What filters you have enabled for that input filter (and what order they're in)
  • Whether you have a rich text editor enabled for single line input (and which one it is, fckeditor, tinymce, etc)
  • What the stored serialized row 'looks' like actually in the database both before and after the problem occurs.

That'd be great thanks.

...And I'm afraid it's infeasible for me to integrate CCK fields into Tablemanager, they're completely different things - the code would have to be ultra complex to compensate for the differences in what the two modules are trying to achieve and I'm afraid I'm just not clever enough to be able to do it... On the plus side though, Tablemanager v2 'borrows' *cough* a whole lot of code/ ideas from cck and views to make compatibility maybe a little easier for someone who knows their way around CCK better than I do. Which I don't... At all... Bah...

As I've not released any code at all for Tablemanager v2 here's a little snippet about it;

Tables are now created as nodes and like CCK creates content types as new individual tables in your database, so does Tablemanager. It'll make creating custom sql display queries a whole lot easier than the serialized arrays Tablemanager works with now. There's a new set of pluggable modules (in the same way Tablemanager v1.5 for Drupal 6.x has) which include a query builder like Views 2.x, so non-coders will be able to create complex sql queries without knowing anything about sql (okay so I'm having a lot of trouble with this, but it's in the pipeline). ...Blah, blah, blah - I snipped that from another post - I've written quite a lot in previous issues about v2 of Tablemanager so please refer to them for more info on the changes in functionality!

Pobster

#2

asb - April 27, 2008 - 23:55

Hi pobster,

> Which input filter you're using?

Default input format: PEAR Wiki Filter

> What filters you have enabled for that input filter (and what order they're in)

-9 Footnotes Textile style
-7 Amazon filter
-6 Code filter
0 PEAR Wiki Filter
2 Tablemanager filter
10 Zeilenumbruchkonverter (line brak converter)

> Whether you have a rich text editor enabled for single line input (and which one it is, fckeditor, tinymce, etc)

No, none at all. What for, I have Wikitags ;)

> What the stored serialized row 'looks' like actually in the database both before and after the problem occurs.

Before:

a:3:{i:0;s:4:"2008";i:1;s:6:"Januar";i:2;s:78:"Veröffentlichung von <a href="http://drupal.org/drupal-5.6">Drupal 4.7.11</a>";}

After saving once:

a:3:{i:0;s:4:"2008";i:1;s:6:"Januar";i:2;s:143:"Veröffentlichung von &lt;a href=&quot;<a href="http://drupal.org/drupal-5.6">http://drupal.org/drupal-5.6</a>&quot;&gt;Drupal 4.7.11&lt;/a&gt;";}

I hope this helps.

Thanks & greetings, -asb

PS: The idea about CCK fields as table manage data types was not supposed to be a serious suggestion (even I'd be some kind of cool ;)

#3

pobster - April 28, 2008 - 21:10

Ah excellent I don't need to install Drupal 5.x I can see quite clearly what's happening here... I'm passing the entry through the filter and *then* storing it in the database. I thought that was what you're supposed to do... Pass user input through Drupals filter system to make sure that it's not doing anything naughty and then store it... Of course... Doing that is converting your link [http://drupal.org/drupal-5.5 Drupal 5.5] actually into what it's supposed to represent; <a href="http://drupal.org/drupal-5.5">Drupal-5.5</a> and then it's storing it in the database. When you edit it, rather than give you back this; [http://drupal.org/drupal-5.5 Drupal 5.5] you're getting the link and your html input filter obviously isn't set to accept links. Now this is a problem... As I really don't know what I'm supposed to do here? I think I'm going to need to take some advice... Obviously I can't just store whatever the user inputs unchecked and then pass it through the filter only when it's displayed, as anything which is stored in the database needs checking for malicious input. Hmmm... I'll get back to you on this...

Pobster

#4

pobster - August 25, 2009 - 17:17
Version:5.x-1.4» 6.x-1.x-dev
Priority:normal» critical
Assigned to:Anonymous» pobster

#5

pobster - August 25, 2009 - 17:21
Version:6.x-1.x-dev» HEAD
 
 

Drupal is a registered trademark of Dries Buytaert.