Jump to content


Photo

How to find elements with empty field


  • Please log in to reply
22 replies to this topic

#21 Soma

Soma

    Hero Member

  • Moderators
  • 3,218 posts
  • 1766

  • LocationSH, Switzerland

Posted 14 February 2012 - 04:32 PM

code also checked, even in new file.


Only new file and copied over? Have you tried rewrite the line of code that causes the issue from scratch? You laugh, but I got an situation where it just wouldn't work with a selector, turned out there was a hidden char not visible at all even in "showinvisible" mode.

@somartist | modules created | support me, flattr my work flattr.com


#22 elmr

elmr

    Jr. Member

  • Members
  • PipPip
  • 10 posts
  • 0

Posted 14 February 2012 - 05:08 PM

Soma I've rewritten the code and it was the same but...another strange thing.

I thought it may be connected with pager so I removed rendering pager, disabled page numbers for this particular page and changed code to :
$pages->find('template=movie, limit=10')->not("youtube_id=''");
But it didn't show any results.

So I removed limit=10 and then it worked properly. Movies with empty fields didn't show up. But still I didn't have pager functionality, so I brought back rendering pager, enabled page numbers and added limit=10 again... and now it's working right... with the code and the same settings with which it was not working few minutes ago.

It's really strange and I have no idea what can be the reason of this behaviour :-/

#23 ryan

ryan

    Hero Member

  • Administrators
  • 5,805 posts
  • 3130

  • LocationAtlanta, GA

Posted 15 February 2012 - 04:08 PM

It's really strange and I have no idea what can be the reason of this behaviour


Any time when I've had behavior like this it's because I was using either template caching or markup caching, and didn't realize I was seeing cached versions. So make sure you are logged in when changing around stuff (or that you aren't using caching).

We've also noticed that TinyMCE can store characters in text fields that aren't otherwise visible (even looking directly in the database). I had to go in with a hex editor before I could see the UTF-8 non-breaking space TinyMCE had inserted. So if your text field has been used with TinyMCE at some point, that's something to consider.

Table repair is also something to consider when you see strange results. That will cause MySQL to rebuild the index for the table. But I wouldn't expect this to be necessary unless someone has changed a MySQL setting (like ft_min_word_len) and not rebuilt all the database indexes.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users