-
Bug
-
Resolution: Fixed
-
Critical
-
9.5.0, 9.5.0.1
-
Security Level: Jimmy
Steps to Reproduce
Create any implementation of org.zkoss.zk.ui.util.PerformanceMeter (or use performanceMonitor)
Register in listener in zk.xml
Current Result
Any zkau request will fail with
"Server unavailable, (req) is not defined (reference Error)"
Expected Result
No error
Debug Information
Cause by ZK-4175
the req variable no longer exists, causing reference error when zk.perfMon is set.
Workaround
<script><![CDATA[ zk.afterLoad("zk", function () { var _xzAu = {}; console.log("zk loaded") zk.override(zAu, _xzAu, { _onResponseReady: function (response) { var reqInf = zAu.ajaxReqInf, sid; try { if (response && response.ok) { zAu.ajaxReq = zAu.ajaxReqInf = null; if (zk.pfmeter) zAu._pfrecv(reqInf.dt, zAu.pfGetIds(response)); sid = response.headers.get('ZK-SID'); var rstatus; if ((rstatus = response.status) == 200) { //correct if (zAu._respSuccess(response, reqInf, sid)) return; } else if ((!sid || sid == zAu.seqId) //ignore only if out-of-seq (note: 467 w/o sid) && !zAu.onResponseError(response, zAu._errCode = rstatus)) { if (zAu._respFailure(response, reqInf, rstatus)) return; } } } catch (e) { if (zAu._respException(response, reqInf, e)) return; } zAu.afterResponse(sid); } }); }); ]]></script>
- relates to
-
ZK-4175 replace XHR with the fetch() API to allow SSO redirect handling
- Closed