Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error after installing plugin #9

Closed
CashDesk opened this issue Mar 12, 2019 · 9 comments
Closed

Error after installing plugin #9

CashDesk opened this issue Mar 12, 2019 · 9 comments

Comments

@CashDesk
Copy link

CashDesk commented Mar 12, 2019

I upgraded to 1,11
I added a row with 'Signal::send('ticket.before.delete', $this); // Archiver plugin: Added to archive tickets before deleting them. to the 'class.ticket.php' file.
After this change, i cannot open an existing attachment. I get a windows error that the file is corrupt.
After restoring the original file it works again.

Seems that I did something wrong?

I had the folowing:

function delete($comments='') {
global $ost, $thisstaff;

Signal::send('ticket.before.delete', $this); // Archiver plugin: Added to archive tickets before deleting them.

//delete just orphaned ticket thread & associated attachments.
// Fetch thread prior to removing ticket entry
$t = $this->getThread();
@CashDesk
Copy link
Author

@clonemeagain, any idea what i did wrong?

@clonemeagain
Copy link
Owner

Hey chief, can you post the file with the mod, or should I make a copy you can just slot in there.. that's probably easier. You don't need it for deleting, just archiving. Been meaning to work on it, but super busy.

@CashDesk
Copy link
Author

class.ticket.-archive.zip
Here you are and thanks for your help!

@CashDesk
Copy link
Author

CashDesk commented Mar 24, 2019 via email

@CashDesk
Copy link
Author

Hi @clonemeagain , did you had time to check it? Thanks for your reply

@clonemeagain
Copy link
Owner

Dang, totally forgot. I've put it in my calendar for tomorrow mate. Should really check this more.

@clonemeagain
Copy link
Owner

Ok, I've tested it with 1.11 on PHP 7 and it works. I'm not getting any server errors, well, none related to the plugin, if you crank up the logging it's quite a list to dig through.

https://gist.github.com/clonemeagain/40c4a026d292789375a2caf2c983253d

Generated by modifying bootstrap.php to include an error-handler, ie:

function errorHandler($errno, $errstr, $errfile, $errline) {
 
    switch ($errno) {
        case E_NOTICE:
        case E_USER_NOTICE:
        case E_DEPRECATED:
        case E_USER_DEPRECATED:
        case E_STRICT:
            error_log("STRICT error $errstr at $errfile:$errline n");
            break;
 
        case E_WARNING:
        case E_USER_WARNING:
            error_log("WARNING error $errstr at $errfile:$errline n");
            break;
 
        case E_ERROR:
        case E_USER_ERROR:
        case E_RECOVERABLE_ERROR:
            exit("FATAL error $errstr at $errfile:$errline n");
 
        default:
            error_log("Unknown error at $errfile:$errline n");
    }
}
 
set_error_handler("errorHandler");

You should not do that on production systems, but if you are still having an issue, please enable the logging and send me the link, or email it to me clonemeagain@gmail.com

I've modified the ReadMe and uploaded copies of the Tagged releases with the mod, I think your file is probably right, so it's a mystery. You can try my versions if you like, they are just that one line change from core.

clonemeagain added a commit that referenced this issue Apr 14, 2019
Updating readme, adding pre-edited copies of class.ticket.php for last three versions of osTicket core copied straight from the source repo and with the MOD added, you only need the MOD if you want to enable Archiving.

Relates to #9
@CashDesk
Copy link
Author

@clonemeagain i tried with my file and got the same erros. After that i copied yours and it seems to work now.
Thanks!

@clonemeagain
Copy link
Owner

Ok cool. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants