gkrid / dokuwiki-plugin-structjoin

GNU General Public License v2.0
1 stars 0 forks source link

FEATURE REQUEST: Bureaucracy plugin compatibility #2

Open ooleanderoo opened 3 years ago

ooleanderoo commented 3 years ago

Hi,

is it maybe possible to change the behaviour of the field that it instantly updates by changing the corresponding value in a bureaucracy form? Like in your example if I got the two schemes: customer scheme:

"columns": [
{
    "colref": 1,
    "ismulti": false,
    "isenabled": true,
    "sort": 10,
    "label": "name",
    "class": "Text",
},
{
    "colref": 2,
    "ismulti": false,
    "isenabled": true,
    "sort": 20,
    "label": "address",
    "class": "Text"
}
]

product scheme

"columns": [
{
    "colref": 1,
    "ismulti": false,
    "isenabled": true,
    "sort": 10,
    "label": "Id",
    "class": "Text",
},
{
    "colref": 2,
    "ismulti": false,
    "isenabled": true,
    "sort": 20,
    "label": "customer",
    "class": "Lookup",
    "config": {
        "schema": "customer",
        "field": "name"
    }
},
{
    "colref": 3,
    "ismulti": false,
    "isenabled": true,
    "sort": 30,
    "label": "customer_address",
    "class": "Join",
    "config": {
        "schema": "customer",
        "field": "address"
    }
}
]

that when i use a bureaucracy form like:

<form>
action template templates:example "projects:page"
struct_field "product.customer"
struct_field "product.customer_adress" //best would be to be able to use struct_fieldhidden
...

the second field is automaticaly filled with the corresponding information so i can use it for specific placeholders in my template.

vic-t commented 8 months ago

In spite of bureaucracy not showing the underlying value of the join field but rather just a label with the name of the field, it used to be possible to submit a form and the target struct would be correctly populated.

A change in struct and/or bureaucracy that must have happened at some point before August 2023, broke this functionality. Bureaucracy now expects for the value to be part of the form itself and throws an error if it's not. A similar report was created back in 2022 about values of regular struct lookup fields no longer being transmitted by bureaucracy, see https://github.com/splitbrain/dokuwiki-plugin-bureaucracy/issues/313.

As such, I doubt that this is something that can be corrected in the structjoin plugin. For the time being, I submitted a bug report for the struct plugin, see https://github.com/cosmocode/dokuwiki-plugin-struct/issues/709.