Problem with filtering

Problem with filtering

skepticismevanskepticismevan Posts: 6Questions: 0Answers: 0
edited July 2010 in Bug reports
Hi,
I've noticed that the filtering tool ignores completely rows that include and tags. Is this supposed to be happening and is there a way to work around the problem (barring an upgrade). The row is also ignored if there's is a blank line left after the code in the cell and before the or tag.

[I use the DataTables included in the WP-Table-Reloaded plugin with Opera, but the problem persists with Firefox as well]

Thanks for your time.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Can you post a link to an example showing this problem please? This should not be occurring like this.

    Allan
  • skepticismevanskepticismevan Posts: 6Questions: 0Answers: 0
    Yes. Look at this table I was working on when I realized the issue: http://blog.atheia.gr/alsoread/quotes/

    (Note: I did some snooping around of my own in the mean time. I retested with updated browsers. Explorer and Firefox filter normally (perhaps my last mishap was just a glitch with Firefox). Opera stubbornly refuses to cooperate. So it appears the problem is Opera related (v.10.60 International)

    Line 1, 2 and 3 have tags.
    Line 4 has no but has a blank line at the end (in the Source Code, this is translated as
    )
    Line 5 looks identical to 4 but doesn't have a blank line at the end of the cell code.
    Line 6 is similar to 2 but with no
    Line 7 has a blank at the end and I just dropped in "Asimov" at the end.

    Filter for Dawkins (appears 3 times). I only get line 5.
    Filter for Asimov (appears 3 times). I only get line 6.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Thanks for the link. Honestly I don't know what is happening here. The search array that DataTables uses has the correct text in it for your table - but it obviously isn't matching correctly. I don't understand why that would be... Perhaps a bug in Opera when dealing with the language in your strings? Is it easy to cut your strings down a bit? The first step would be to drop them to just the link to the author and see if that works. I expect at some point something will break the search...

    Allan
  • skepticismevanskepticismevan Posts: 6Questions: 0Answers: 0
    I did as you suggested and deleted all the greek text (you can take a look, I saved it for you). The filter now ignores only the lines that end in
    , so apparently language IS an issue up to a point.

    Is there a chance the encoding in the filter box is different than that in the body? (I might assume this would be an issue for greek characters, but can't really understand why it would pose a problem for latin characters).

    About Opera, from my experience, it seems that it translates HTML more rigidly and is less forgiving of coding errors (for instance, Firefox would ignore a missing closing tag, when Opera strictly interprets it and screws up the whole page). Honestly, I wouldn't think this would be an issue in this day and age.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi skepticismevan,

    There is something funny going on and I can't quite place it at the moment... Could you do me a favour and load DataTables from the following address so I can attempt to debug it? http://datatables.net/dev/jquery.dataTables.skepticismevan.js . Of course if your site is public and the debug might be seen, perhaps you could duplicate the page and link to that?

    Thanks very much,
    Allan
  • skepticismevanskepticismevan Posts: 6Questions: 0Answers: 0
    I am not exactly sure what you mean...
    The only file that comes close to what you're describing in the WP-Table-Reloaded plugin is a file called jquery.datatables.min.js

    In favour of alacrity, I replaced its contents with the contents of the file you linked to in an inactive sister site and then created an almost identical table. I imagine this is what you wanted, but lemme know if you need me to take some more specialized action. Here's the link:

    http://english.stratis-space.com/quotes/

    Results:
    The table I've already shown you (lines 1-7) filter normally. Mission Accomplished here.
    Look at those I've added for experimentation:

    Line 8 has a
    between quote and author.
    Line 9 is the same without the
    .
    Filter for Montaigne. Line 8 is omitted.

    Line 10-12 also contain a little Java Spoiler at the bottom. Line 10 is a single line of code. Line 11 has a
    at some internal point. Line 12 is the same as 10 with a
    at the end.

    Filter for Dawkins: Line 11 gets ignored. Line 10 and 12 are unaffected (the filter even finds words inside the spoiler)
    ---------------
    I know it seems nuts, but apparently with the new JS file you gave me, the
    tag ruins the filter, if it's IN THE MIDDLE of the HTML code.
  • skepticismevanskepticismevan Posts: 6Questions: 0Answers: 0
    Just noticed that the source code in Opera shows the "break tag" as
    (with a space; dunno, but it might be important)
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    What I was meaning was to change the source file "http://english.stratis-space.com/wp-content/plugins/wp-table-reloaded/js/jquery.datatables.min.js?ver=1.7" to the address I gave so I can modify the Javascript live.

    The reason it's not working is that there a new line character in the string. However, I can't see how it would get in there, nor do any of the other browsers appear to have this issue - so I think it's an Opera bug. There may be a workaround - I'm not sure (since I don't know what is causing it yet!).

    Allan
  • skepticismevanskepticismevan Posts: 6Questions: 0Answers: 0
    *sigh* I have no idea how to do that. Sorry. I have no idea what lines of code I must change in the plugin to make it look online for a file and my PHP knowledge is extremely limited. Thanks for your assistance, anyway. Obviously you eradicated most of the problem, but I need more specific instructions in order to continue.

    BTW, I played around with it a bit more and apparently if I add manually the
    tag (without a space ->
    ) it works normally even in Opera. I'll also let Tobias (creator of the plugin) know of this (since obviously it's his plugin that translates a blank line as a
    with a space)

    I honestly really appreciate your help and the time you spent.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    It's most bizarre this one! I just can't figure out why Opera would have a new line character in the string which is being used for the search. It shouldn't be doing that, since there is code in DataTables to specifically remove newlines. I also tried poking the Javascript on your site with DragonFly with no success, and adding a
    to my own examples. No denying something is wrong, but I just can't see what. I'll continue to experiment and hopefully I'll be able to create an example I can use locally which breaks...

    Allan
This discussion has been closed.