Open virk opened 9 years ago
@michitux can you help with an explanation of this behaviour?
My reasoning sofar is:
The entry data is saved during a metadata render of the entry https://github.com/splitbrain/dokuwiki-plugin-data/blob/master/syntax/entry.php#L137 It uses the current $ID. If included via the include plugin, I assume this $ID is still the id of the included page, not of the hostpage, it isn't?
The include plugin does not include data entries for exactly this reason. @virk removed the code that removes data entries in the include plugin which then - as expected - triggers this problem. Probably the include plugin should only exclude the data plugin for metadata rendering so I don't think this can or should be fixed in the data plugin.
@michitux I do not understand the advantage of the data plugin presenting data several times, if same dataentry is included via include-plugin several times. The data set completely remains the same but is displayed several times in a datatable. In my humble opinion, if this matter is considered to be a "topic", one solution could probably be:
But kindly understand that I am a user only and do not know about any other difficulties which might occur when solving/changing the behaviour :-)
@virk: the include plugin includes pages in a relative smart manner. Therefore it renders among other things also metadata. The data plugin hooks in the metadata renderer for saving its content to the database. My assumption is that it creates here duplicates by using the ID of the host page instead of included page.
This issue is solved at the moment in the include plugin by just excluding the whole data entry. This is a bit bold solution.
Therefore @michitux suggests:
I have adjusted the include-plugin to display structured data content. But one problem remains: Imagine the following situation:
On the page project:2501:2550:2533 there is the following content:
On the page projects:2501:2550:2533:2533_01 there is the following content:
On the page projects:2501:2550:2533:2533_02 there is the following content:
If I now display all AAB by using:
the line for number 2533 is shown twice in the datatable: One line appears and %pageid% "projects:2501:2550:2533" is shown and one line appears and %pageid% "projects:2501:2550:2533:2533_02" is shown.
From my point of view this behaviour is not quite convenient. I would prefer if the data was only displayed once with the reference page "projects:2501:2550:2533:2533_02", where the data really is written. "Structured data plugin" should not look after data, which only appears due to the fact, that some pages are glued together by the include-plugin.
I would appreciate your comments, fixes, work-arounds if you should find some time!