1. Christian Salazar
  2. YiiFileManagerFilePicker
Issue #4 resolved

when yiifileman_on_action is returning something different to TRUE then the client side dialog box must remain oppened.

Christian Salazar
repo owner created an issue

the yiifileman_on_action says it must return true or false. you can return an error description too, that description is shown in client side by implementing a JS event handler: 'onAfterAction' whose parameters are: viewer, action, file_ids, ok, response.

ok parameter is always true, no matter you return an error in your serverside: yiifileman_on_action, this parameters only informs you the ajax status.

response is the key: is the value returned by: yiifileman_on_action. So here you must validate for "if (response === true) { fine } else { alert(response); } " in where you can inform the resulting error string.

the problem is: the JS client code is always closing the dialog box, no matter an error occurs or not. This behavior must be changed: only close (or hide) the dialog box IF a reported error occurs, in other words when yiifileman_on_action returns something different to: true.

so performing this changes the will solve the issue.

Comments (2)

  1. Log in to comment