splitbrain / dokuwiki-plugin-data

Add and query structured data in your DokuWiki
http://www.dokuwiki.org/plugin:data
GNU General Public License v2.0
50 stars 34 forks source link

Aggregations destroyed after update of SQLite plugin #236

Closed Juergen-aus-Zuendorf closed 10 months ago

Juergen-aus-Zuendorf commented 1 year ago

After SQLite update, the aggregations of the Structured Data Plugin are partially destroyed. Some entries are duplicated, and some columns are empty.

Best regards Juergen

splitbrain commented 1 year ago

Thanks for opening the issue. Unfortunately your issue does not contain enough information. Please try to provide as much info as possible, generally following these three main questions:

Please also describe what steps you took to analyze the issue and what (failed) attempts you made to fix the problem yourself.

Your issue should contain everything that might help in analyzing and reproducing the issue. That includes but isn't limited to:

Thanks for your help.

PS: You may want to refer to How to Ask Questions the Smart Way for more tips on improving your issue creation game ;-)

Juergen-aus-Zuendorf commented 1 year ago

Error description:

a) First problem:

For example: I have an aggregation of our company employees with the following syntax:

---- datatable ----
cols       : Anrede, %pageid%, Kurzzeichen, Abteilung_person-abt, Telefon, Mobil, Email_mail
header     : Anr.,   Name,     Kurzz.     , Abt.,                 Tel.,    Mobil, Email
filter     : %pageid%~personal:personalstammdaten:*
sort       : %pageid%
dynfilters : 1
----

The aggregation brings as extract this result: image As you can see, from line 2 onwards, the entries are duplicated.

Here is the definition for the item in line 2:

---- dataentry personendaten ----
Anrede                : Hr. # 
Nachname              : Gerold # 
Vorname               : Udo # 
Kurzzeichen           :  # 
Bereich_person-bers   : Verwaltung # 
Abteilung_person-abts : MW, MWS # 
Unterbereichs         : ML # 
Arbeitsplatz          :  # 

After some tests, I've found out the following: The error seems to be dependent on the type aliases, if they allow multiple values. If I delete the second value for "Abteilung_person-abts" the aggregation is correct.

Our release is "2022-07-31a Igor". There are no error logs.

b) Second problem:

I have a syntax like this:

---- datatable ----
cols    : Abteilung, %pageid%, Telefon, Mobil
header  : Abt., Name, Tel., Mobil/Extern
widths  : 5em,20em,5em,10em
filter  : %class% = personendaten
 and    : Abteilung ~ WM*
 and    : Personalfunktion >
 and    : Arbeitsplatz =
sort    : %pageid%
----

When I edit the page the preview shows the right aggregation: image

But when I look at the result (sometimes only after refreshing), the output is destroyed: image The aggregation shows values from totally different data classes.

Attempts to fix the problem: I have deactivated and reactivated the data plugin, but nothing has changed. I haven't yet dared to delete the plugin and reinstall it because I'm afraid of losing the definition of the type aliases in the process.

Best regards Juergen

jnv commented 1 year ago

I second this issue. However, it seems the issue is really with the sqlite plugin and not with the data plugin. My workaround was downgrading the sqlite plugin to version 2022-11-29. I noticed that between the releases there were some attempts to switch to sqlite's native group_concat. Perhaps there are some leftovers after reverting?

splitbrain commented 1 year ago

@jnv can you give the devel branch a try?

jnv commented 1 year ago

@splitbrain I'm running a fork of this plugin with numeric sorting (#204), but from a quick glance I should be able to rebase that on top of devel. I'll give it a try, thanks!

splitbrain commented 10 months ago

Closing this, since no further feedback has been given.