- Edited
KevinTheJedi yes i am certain.
This would be consistent with my initial question why it broke out of nowhere. browser are out of scope of environment and can differ. and i am running same version both in lab and production machines
KevinTheJedi yes i am certain.
This would be consistent with my initial question why it broke out of nowhere. browser are out of scope of environment and can differ. and i am running same version both in lab and production machines
I clearly see a red icon with 1
next to 9 Issues
. So click on that to see what it says.
Cheers.
KevinTheJedi that is incorrect those are issues due to ours internal plugins not specific to Os Ticket chrom is dumping them to separate part of console as issues if error occur, inside page context it would be present in main debug thread as error which is not
KevinTheJedi Nice could you share some light how and what you discovered ?
What do you mean? Simply can replicate the issue you are experiencing. Haven't got too far yet; only been a few minutes.
Cheers.
KevinTheJedi Ohh sorry, i understood that you found the exact think which is causing the issue, I want to help as much as possible
Okay, so my issue was the result of a separate issue someone reported late last week which I do have a temporary patch for. So, in my case I had the ACL enabled for Clients (Users) and we have a bug where if you have ACL enabled for Clients it restricts the ability for Staff to see and download attachments/images as they weren't in the ACL. The below patch skips the Client ACL check if current session is an Staff:
diff --git a/include/class.validator.php b/include/class.validator.php
index 30163b8b..b46ead0e 100644
--- a/include/class.validator.php
+++ b/include/class.validator.php
@@ -367,7 +367,8 @@ class Validator {
$aclbk = $cfg->getACLBackend();
switch($backend) {
case 'client':
- if (in_array($aclbk, array(0,3)))
+ if (in_array($aclbk, array(0,3))
+ || ($aclbk == 2 && StaffAuthenticationBackend::getUser()))
return true;
break;
case 'staff':
After doing this (or disabling the ACL) it all started working flawlessly again.
Cheers.
KevinTheJedi
Interesting but we don't use ACL :/
So if i understand correctly there is maybe different issue on our site. but nice that you at least was able to fount something. As i wrote on GH i done a lot of debugging if issue was same on my site i would not be able to to get base 64 content of file in dump of class.file.php. but iam able to get content of file if i remove headers part
Then yea I simply cannot replicate your issue. I would need either some relevant debug content, some relevant logs, or some way to replicate it to further assist.
ββ¦ remove headers partβ what do you mean by that?
Cheers.
KevinTheJedi in class.file.php there is function download which is used to serv the file loaded from provider, internally calls headers() (to set appropriate headers mime type, content length etc.) getContetn() function which gets content of file. if i just dump contents of file i get content of file if headers are added content is present to browser as image which is invalid for some reason. so either problem lies in headers => no error logs on server site || on site of browser unsupported mime type when used in inline image or something.
This is where the majority of the file download headers actually get set:
Each GET for /file.php should have those headers present to tell the browser how to handle the attachment.
Cheers.
KevinTheJedi Yes i now, this was my debug how to test if there are maybe some issues with permissions or paths, i would not get any content if they would be there Right ?
But i get the content then problem must be related with browser or headers, but don't know how to try to get more detail problem why headers/browser is not correctly read.
is there any possible path how to get Absolut path to attachment file ? (inside file below)
if yes i can try to use my different image serv function i am using in different app based on PHP which is running in same environment correctly. similar to code below
$imageFolder = realpath($imageFolder);
$imageFile = $imageFolder . $vin . '-' . $i . '.jpg';
header('Content-Type: ' . mime_content_type($imageFile));
header('Content-Length: ' . filesize($imageFile));
readfile($imageFile);
exit;
No, you send the key and other needed information to the file.php where it looks up the file, gets the content, etc. and serves it back to the browser. Only other way would be to get the file yourself from db or from the file system.
Edit:
I think you meant from the file system. If thatβs the case then of course. The files are all there by key.
Cheers.
KevinTheJedi shi*** then we are totally scrued , i don't know hat to text next or how to verify that content which is returned to browser is actually an image. If i can get you any more information's let me know i would be sad if we would need to switch off from OST it served us well for many years so far :/ and we were supper happy with it
Read my edit above. Files on filesystem are accesible directly on the server by key.
Cheers.
KevinTheJedi they are in some random subfolders :/ how can i guess name of subfolder ?
gamerclassn7 first letter of key
KevinTheJedi i maybe found our issue, if i parse key as you specified files are not there, if i find them manually by date of creation and time they are there under different key. at least 4 which I tried to found
I'm sorry but that doesn't really make much sense. The file keys and file names on filesystem do not change after they are created. Let's say for example have a link like /file.php?key=fzadgagadsfadfads&expires=...
. The file key in this case would be fzadgagadsfadfads
which means on the filesystem there will be a file named fzadgagadsfadfads
in the f/
directory in your attachment folder. Keep in mind that IIS is case sensitive with the folder names and file names.
Cheers.