mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +00:00
Fixes call to processField (#5943)
* Fixes call to processField - Previously used options.fields? - Should use fields? * Update forms.js
This commit is contained in:
parent
65531f7611
commit
0d7b4f2f17
@ -486,7 +486,15 @@ function extractNestedField(field_name, fields) {
|
|||||||
*/
|
*/
|
||||||
function constructFormBody(fields, options) {
|
function constructFormBody(fields, options) {
|
||||||
|
|
||||||
var html = '';
|
let html = '';
|
||||||
|
|
||||||
|
// Client must provide set of fields to be displayed,
|
||||||
|
// otherwise *all* fields will be displayed
|
||||||
|
const displayed_fields = options.fields || fields || {};
|
||||||
|
|
||||||
|
if(!options.fields) {
|
||||||
|
options.fields = displayed_fields;
|
||||||
|
}
|
||||||
|
|
||||||
// add additional content as a header on top (provided as html by the caller)
|
// add additional content as a header on top (provided as html by the caller)
|
||||||
if (options.header_html) {
|
if (options.header_html) {
|
||||||
@ -516,13 +524,11 @@ function constructFormBody(fields, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const [k,v] of Object.entries(fields)) {
|
for (const [k,v] of Object.entries(fields)) {
|
||||||
processField(k, v, options.fields[k]);
|
if (options.fields && k in options.fields) {
|
||||||
|
processField(k, v, options.fields[k]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Client must provide set of fields to be displayed,
|
|
||||||
// otherwise *all* fields will be displayed
|
|
||||||
var displayed_fields = options.fields || fields;
|
|
||||||
|
|
||||||
// Override default option values if a 'DELETE' form is specified
|
// Override default option values if a 'DELETE' form is specified
|
||||||
if (options.method == 'DELETE') {
|
if (options.method == 'DELETE') {
|
||||||
if (!('confirm' in options)) {
|
if (!('confirm' in options)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user