Community Support for OpenDocMan (Deprecated)

Full Version: 1.2.6.X mimetype and Filter By bugs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Guest

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
Code:
File::mime($_FILES['file']['tmp_name'][$count])
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:

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!
Hi Scotty,

Re: Mimetypes. Are you using the 1.2.6.5 release or something earlier?

Guest

Stephen Wrote:Hi Scotty,

Re: Mimetypes. Are you using the 1.2.6.5 release or something earlier?

1.2.6.4 currently. I haven't upgraded to 1.2.6.5 yet.
Stephen Wrote:Hi Scotty,

Re: Mimetypes. Are you using the 1.2.6.5 release or something earlier?

Has there been any update to this? The ability to upload zip files is crucial to me.
Hello Admin,

I am experiencing the same 'Filter By' problem as already mentioned by Scottie. I am using version v1.2.6.6. When i add some custom fields and try to search through home page 'Filter By' options, the system show some warnings+notices with no search results.

Notice: Undefined offset: 0 in C:\xampp\htdocs\edms\udf_functions.php on line 641

Notice: Undefined offset: 0 in C:\xampp\htdocs\edms\udf_functions.php on line 642

Notice: Undefined offset: 0 in C:\xampp\htdocs\edms\udf_functions.php on line 643

Notice: Undefined offset: 0 in C:\xampp\htdocs\edms\udf_functions.php on line 643

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\edms\search.php on line 184
No Files Found

Please let me if this bug is fixed.

Thanks
Hi Scottie,

Can you please guide me what hacks you used to overcome the 'Filter By' problem at Home Page. I am experiencing the same problem with version 1.2.6.6.

Thanks