03-14-2013, 05:07 AM
Howdy,
I have been monkeying with 1.2.6.X versions, and I found 2 bugs which I basically monkey-patched to keep the natives happy:
The mimetype problem seems to be highly irritated by the fact that when using Firefox to upload a DOCX file, the $file_mime variable returned from in check-in.php and add.php ends up being an empty string. This obviously causes the invalid mime type message. The only way to get around this was to add a check that says if $file_mime is empty, skip the check. This is apparently a very annoying and long-standing issue with Firefox and mime types...
The second problem our users have noticed is that the "Filter By" JS on the Home page (out.php) doesn't work for added UDF fields. I added some debug comments in both functions.php and search.php in order to compare the query strings being sent to search.php from each of these...
It turns out that from search.php, the query string will look like this:
But from the Filter By JS on the Home page, it will look like this:
Note that here, WHERE = "Language_only", not "Language". It appears that for UDFs, the "_only" must be stripped, but for built-in fields, it's necessary.
Thus, the Filter By version will not work with UDFs, since that will execute udf_functions_search() in udf_functions.php, with the following query:
But $dn will be "Language_only", and not "Language" as it should be. Thus, the query returns 0 results when using Filter By with UDFs on the Home page, but doing the same search from the Search page works fine.
Note that "Language" is our custom field in this case.
Anyway, I basically inserted some little hacks to work around this stuff, because maybe I'm the only experiencing these errors. But if not, hopefully that will help out a bit if they actually are bugs!
I have been monkeying with 1.2.6.X versions, and I found 2 bugs which I basically monkey-patched to keep the natives happy:
The mimetype problem seems to be highly irritated by the fact that when using Firefox to upload a DOCX file, the $file_mime variable returned from
Code:
File::mime($_FILES['file']['tmp_name'][$count])
The second problem our users have noticed is that the "Filter By" JS on the Home page (out.php) doesn't work for added UDF fields. I added some debug comments in both functions.php and search.php in order to compare the query strings being sent to search.php from each of these...
It turns out that from search.php, the query string will look like this:
Code:
keyword=French&where=Language&submit=Search&
But from the Filter By JS on the Home page, it will look like this:
Code:
submit=submit&sort_by=id&where=Language_only&sort_order=asc&keyword=French&exact_phrase=on
Note that here, WHERE = "Language_only", not "Language". It appears that for UDFs, the "_only" must be stripped, but for built-in fields, it's necessary.
Thus, the Filter By version will not work with UDFs, since that will execute udf_functions_search() in udf_functions.php, with the following query:
Code:
$query = "SELECT table_name,field_type FROM {$GLOBALS['CONFIG']['db_prefix']}udf WHERE display_name = \"" . $dn . "\"";
But $dn will be "Language_only", and not "Language" as it should be. Thus, the query returns 0 results when using Filter By with UDFs on the Home page, but doing the same search from the Search page works fine.
Note that "Language" is our custom field in this case.
Anyway, I basically inserted some little hacks to work around this stuff, because maybe I'm the only experiencing these errors. But if not, hopefully that will help out a bit if they actually are bugs!