Details
- 
    
Bug
 - 
    Resolution: Fixed
 - 
    
Major
 - 
    10.6
 - 
    None
 
- 
        High
 - 
        Trivial
 - 
        N/A
 - 
        N/A
 - 
        
 
Description
I'm using in ChangeRequest a LiveData with data coming from an xclass using standard results page. My xclass contains a Page property, and I have xobjects using that property with not existing references. More specifically I have an xobject containing two references in the same field: one pointing to an existing document, the other one to a missing one.
When displaying the data in the LiveData I obtained the attached screenshots: both links are displayed in the UI as if they concerns missing pages, however the link are properly created one to /create/ action, the other one to /view/ action.
When looking on the DOM it seems the problem might be the way the HTML is created: the class is wrapping both links.
Here's the JSON used to create the LiveData:
{
  "links": [
    {
      "href": "http://localhost:8080/xwiki/rest/liveData/sources/liveTable/entries",
      "rel": "self",
      "type": null,
      "hrefLang": null
    },
    {
      "href": "http://localhost:8080/xwiki/rest/liveData/sources/liveTable?namespace=wiki%3Axwiki&sourceParams.translationPrefix=changerequest.livetable.&sourceParams.queryFilters=currentlanguage%2Chidden&sourceParams.className=ChangeRequest.Code.ChangeRequestClass",
      "rel": "http://www.xwiki.org/rel/parent",
      "type": null,
      "hrefLang": null
    }
  ],
  "entries": [
    {
      "links": [
        {
          "href": "http://localhost:8080/xwiki/rest/liveData/sources/liveTable/entries/ChangeRequest.Data.CR2-e2672e0c-e378-497c-8f94-0ce2ece0d414.WebHome?namespace=wiki%3Axwiki&sourceParams.translationPrefix=changerequest.livetable.&sourceParams.queryFilters=currentlanguage%2Chidden&sourceParams.className=ChangeRequest.Code.ChangeRequestClass",
          "rel": "self",
          "type": null,
          "hrefLang": null
        },
        {
          "href": "http://localhost:8080/xwiki/rest/liveData/sources/liveTable/entries?namespace=wiki%3Axwiki&sourceParams.translationPrefix=changerequest.livetable.&sourceParams.queryFilters=currentlanguage%2Chidden&sourceParams.className=ChangeRequest.Code.ChangeRequestClass",
          "rel": "http://www.xwiki.org/rel/parent",
          "type": null,
          "hrefLang": null
        }
      ],
      "values": {
        "doc.space_url": "http://localhost:8080/xwiki/bin/view/ChangeRequest/Data/CR2-e2672e0c-e378-497c-8f94-0ce2ece0d414/",
        "doc.hasedit": true,
        "doc.hasdelete": true,
        "doc.copy_url": "http://localhost:8080/xwiki/bin/view/ChangeRequest/Data/CR2-e2672e0c-e378-497c-8f94-0ce2ece0d414/?xpage=copy",
        "status_value": "ready_for_review",
        "doc.rename_url": "http://localhost:8080/xwiki/bin/view/ChangeRequest/Data/CR2-e2672e0c-e378-497c-8f94-0ce2ece0d414/?xpage=rename&step=1",
        "doc.creationDate": "2022/02/01 17:18",
        "doc.hasrename": true,
        "authors_value": "xwiki:XWiki.surli",
        "doc.objectCount": 1,
        "changedDocuments": "                      <a href=\"http://localhost:8080/xwiki/bin/view/Foo%27s%20page/\">Foo's page</a>\n\n",
        "doc.hasadmin": true,
        "doc.date": "2022/02/01 17:18",
        "doc.title": "Change Request: CR2",
        "doc.url": "http://localhost:8080/xwiki/bin/view/ChangeRequest/Data/CR2-e2672e0c-e378-497c-8f94-0ce2ece0d414/",
        "doc.title_raw": "CR2",
        "doc.hidden": false,
        "doc.wiki": "xwiki",
        "doc.hasrights": true,
        "doc.creator": "Unknown User",
        "doc.delete_url": "http://localhost:8080/xwiki/bin/delete/ChangeRequest/Data/CR2-e2672e0c-e378-497c-8f94-0ce2ece0d414/WebHome",
        "doc.fullName": "ChangeRequest.Data.CR2-e2672e0c-e378-497c-8f94-0ce2ece0d414.WebHome",
        "doc.rights_url": "http://localhost:8080/xwiki/bin/admin/ChangeRequest/Data/CR2-e2672e0c-e378-497c-8f94-0ce2ece0d414/WebPreferences?editor=spaceadmin§ion=PageRights",
        "authors_url": "",
        "status_url": "",
        "doc.wiki_url": "http://localhost:8080/xwiki/bin/view/Main/",
        "changedDocuments_url": "",
        "doc.edit_url": "http://localhost:8080/xwiki/bin/edit/ChangeRequest/Data/CR2-e2672e0c-e378-497c-8f94-0ce2ece0d414/WebHome",
        "changedDocuments_value": "[Foo's page.WebHome]",
        "doc.author_url": "http://localhost:8080/xwiki/bin/view/XWiki/XWikiGuest",
        "doc.hascopy": true,
        "doc.name": "WebHome",
        "doc.viewable": true,
        "doc.location": "                                                                                                                                                                                                    <ol  class=\"breadcrumb breadcrumb-expandable\" data-entity='ChangeRequest.Data.CR2-e2672e0c-e378-497c-8f94-0ce2ece0d414.WebHome' data-limit='5' data-plain='false' data-local='true' data-displaytitle='false'><li\n                                    class=\"space\"><a href=\"http://localhost:8080/xwiki/bin/view/ChangeRequest/\"\n        >ChangeRequest</a></li><li                                    class=\"space\"><a href=\"http://localhost:8080/xwiki/bin/view/ChangeRequest/Data/\"\n        >Data</a></li><li                                                          class=\"active space\"><a href=\"http://localhost:8080/xwiki/bin/view/ChangeRequest/Data/CR2-e2672e0c-e378-497c-8f94-0ce2ece0d414/\"\n        >CR2-e2672e0c-e378-497c-8f94-0ce2ece0d414</a>      </li></ol>\n  ",
        "doc.author": "Unknown User",
        "doc.space": "ChangeRequest.Data.CR2-e2672e0c-e378-497c-8f94-0ce2ece0d414",
        "authors": "                                                                                        <ul class=\"users\"><li class=\"user\" data-reference=\"xwiki:XWiki.surli\"><img class=\"user-avatar\" src=\"http://localhost:8080/xwiki/bin/skin/resources/icons/xwiki/noavatar.png?cache-version=1643644590960\" alt=\"surli\" /><a class=\"user-name\" href=\"http://localhost:8080/xwiki/bin/view/XWiki/surli\">surli</a></li></ul>\n  ",
        "status": "Ready for review"
      }
    },
    {
      "links": [
        {
          "href": "http://localhost:8080/xwiki/rest/liveData/sources/liveTable/entries/ChangeRequest.Data.CR1-69ecf28b-4dbc-4c44-bcb0-9e57ac42da47.WebHome?namespace=wiki%3Axwiki&sourceParams.translationPrefix=changerequest.livetable.&sourceParams.queryFilters=currentlanguage%2Chidden&sourceParams.className=ChangeRequest.Code.ChangeRequestClass",
          "rel": "self",
          "type": null,
          "hrefLang": null
        },
        {
          "href": "http://localhost:8080/xwiki/rest/liveData/sources/liveTable/entries?namespace=wiki%3Axwiki&sourceParams.translationPrefix=changerequest.livetable.&sourceParams.queryFilters=currentlanguage%2Chidden&sourceParams.className=ChangeRequest.Code.ChangeRequestClass",
          "rel": "http://www.xwiki.org/rel/parent",
          "type": null,
          "hrefLang": null
        }
      ],
      "values": {
        "doc.space_url": "http://localhost:8080/xwiki/bin/view/ChangeRequest/Data/CR1-69ecf28b-4dbc-4c44-bcb0-9e57ac42da47/",
        "doc.hasedit": true,
        "doc.hasdelete": true,
        "doc.copy_url": "http://localhost:8080/xwiki/bin/view/ChangeRequest/Data/CR1-69ecf28b-4dbc-4c44-bcb0-9e57ac42da47/?xpage=copy",
        "status_value": "ready_for_review",
        "doc.rename_url": "http://localhost:8080/xwiki/bin/view/ChangeRequest/Data/CR1-69ecf28b-4dbc-4c44-bcb0-9e57ac42da47/?xpage=rename&step=1",
        "doc.creationDate": "2022/02/01 17:15",
        "doc.hasrename": true,
        "authors_value": "xwiki:XWiki.surli",
        "doc.objectCount": 1,
        "changedDocuments": "                                    <span class=\"wikicreatelink\"><a href=\"http://localhost:8080/xwiki/bin/create/Foo%27s%20page/Under%20foo/WebHome\">Under foo</a><span/>, <a href=\"http://localhost:8080/xwiki/bin/view/Foo%27s%20page/\">Foo's page</a>\n\n",
        "doc.hasadmin": true,
        "doc.date": "2022/02/01 17:16",
        "doc.title": "Change Request: CR1",
        "doc.url": "http://localhost:8080/xwiki/bin/view/ChangeRequest/Data/CR1-69ecf28b-4dbc-4c44-bcb0-9e57ac42da47/",
        "doc.title_raw": "CR1",
        "doc.hidden": false,
        "doc.wiki": "xwiki",
        "doc.hasrights": true,
        "doc.creator": "Unknown User",
        "doc.delete_url": "http://localhost:8080/xwiki/bin/delete/ChangeRequest/Data/CR1-69ecf28b-4dbc-4c44-bcb0-9e57ac42da47/WebHome",
        "doc.fullName": "ChangeRequest.Data.CR1-69ecf28b-4dbc-4c44-bcb0-9e57ac42da47.WebHome",
        "doc.rights_url": "http://localhost:8080/xwiki/bin/admin/ChangeRequest/Data/CR1-69ecf28b-4dbc-4c44-bcb0-9e57ac42da47/WebPreferences?editor=spaceadmin§ion=PageRights",
        "authors_url": "",
        "status_url": "",
        "doc.wiki_url": "http://localhost:8080/xwiki/bin/view/Main/",
        "changedDocuments_url": "",
        "doc.edit_url": "http://localhost:8080/xwiki/bin/edit/ChangeRequest/Data/CR1-69ecf28b-4dbc-4c44-bcb0-9e57ac42da47/WebHome",
        "changedDocuments_value": "[Foo's page.Under foo.WebHome, Foo's page.WebHome]",
        "doc.author_url": "http://localhost:8080/xwiki/bin/view/XWiki/XWikiGuest",
        "doc.hascopy": true,
        "doc.name": "WebHome",
        "doc.viewable": true,
        "doc.location": "                                                                                                                                                                                                    <ol  class=\"breadcrumb breadcrumb-expandable\" data-entity='ChangeRequest.Data.CR1-69ecf28b-4dbc-4c44-bcb0-9e57ac42da47.WebHome' data-limit='5' data-plain='false' data-local='true' data-displaytitle='false'><li\n                                    class=\"space\"><a href=\"http://localhost:8080/xwiki/bin/view/ChangeRequest/\"\n        >ChangeRequest</a></li><li                                    class=\"space\"><a href=\"http://localhost:8080/xwiki/bin/view/ChangeRequest/Data/\"\n        >Data</a></li><li                                                          class=\"active space\"><a href=\"http://localhost:8080/xwiki/bin/view/ChangeRequest/Data/CR1-69ecf28b-4dbc-4c44-bcb0-9e57ac42da47/\"\n        >CR1-69ecf28b-4dbc-4c44-bcb0-9e57ac42da47</a>      </li></ol>\n  ",
        "doc.author": "Unknown User",
        "doc.space": "ChangeRequest.Data.CR1-69ecf28b-4dbc-4c44-bcb0-9e57ac42da47",
        "authors": "                                                                                        <ul class=\"users\"><li class=\"user\" data-reference=\"xwiki:XWiki.surli\"><img class=\"user-avatar\" src=\"http://localhost:8080/xwiki/bin/skin/resources/icons/xwiki/noavatar.png?cache-version=1643644590960\" alt=\"surli\" /><a class=\"user-name\" href=\"http://localhost:8080/xwiki/bin/view/XWiki/surli\">surli</a></li></ul>\n  ",
        "status": "Ready for review"
      }
    }
  ],
  "count": 2,
  "offset": 0,
  "limit": 10
}
Attachments
Issue Links
- is related to
 - 
                    
XWIKI-8587 Add a Document field type that has a picker associated which suggests document names
-         
 - Closed
 
 -