[
https://issues.apache.org/jira/browse/MYFACES-4685?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17893941#comment-17893941
]
Werner Punz commented on MYFACES-4685:
--------------------------------------
I cannot reproduce it on any browser on my machine, not even firefox, but
thanks for pointing the part out, I will revisit the code!
> TypeError: newBodyData is undefined
> -----------------------------------
>
> Key: MYFACES-4685
> URL: https://issues.apache.org/jira/browse/MYFACES-4685
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 2.3.11
> Reporter: Volodymyr Siedlecki
> Assignee: Werner Punz
> Priority: Major
> Attachments: image-2024-10-29-11-53-59-387.png,
> image-2024-10-29-12-00-44-931.png, jsf_ajax_keyword_web.war,
> jsf_ajax_keyword_web.war.zip
>
>
>
> The variable newBodyData is undefined in the current JSF 2.3 snapshot. This
> is reproducible via the jsf_ajax_keyword_web.war (attached). Please set the
> project stage to development.
> The issue seems to be that the quirks/_AjaxResponseQuirks.js's _replaceBody
> method is used instead of the xhrCore/_AjaxResponse.js's code.
> Head data is pulled, and the passed into _replaceBody.
>
> {code:java}
> var parsedData = this._replaceHead(request, context, cDataBlock);
> ('undefined' != typeof parsedData && null != parsedData)
> ? this._replaceBody(request, context, cDataBlock, parsedData) :
> this._replaceBody(request, context, cDataBlock);
> {code}
>
> Then the head data is selected (3rd arg):
> {code:java}
> doc = (arguments.length > 3) ? arguments[3] : _Lang.parseXML(newData);{code}
> Then leads to the problem that no body element exists when it's extracted
> next, leaving it to be undefined:
> {code:java}
> var newBodyData = doc.getElementsByTagName("body")[0];{code}
> See stack trace here:
> {noformat}
> TypeError: newBodyData is undefined
> _replaceBody
> http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:8803
>
> processUpdate
> http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:8273
>
> processChanges
> http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:8215
>
> processResponse
> http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:7905
>
> response
> http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:10043
>
> response
> http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:10523
>
> onsuccess
> http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:7447
>
> hitch
> http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:2408
>
> mixMaps
> http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:2439
>
> send
> http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:7349
>
> enqueue
> http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:6152
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)