#1 January 19, 2023 3:55pm

doon.mok
Member
Registered: May 6, 2015
Posts: 144

Matrix field showing ID in module

We are using a matrix field type in a module. When add/edit the field, it shows the ID instead of the title. We have the checkbox as "Use as title" for the column we want. We upgraded to bigtree 4.5.1 and not sure if this is a bug or something we need to do differently?

URL is picture of matrix from developer>module and module, it should say Board Certification instead of 5
https://ibb.co/mTLhkwS

Offline

#2 January 19, 2023 4:02pm

doon.mok
Member
Registered: May 6, 2015
Posts: 144

Re: Matrix field showing ID in module

It should be showing description instead of value.

Offline

#3 January 20, 2023 10:24am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: Matrix field showing ID in module

I'll try to take a look into this issue this weekend!

Offline

#4 March 16, 2023 9:53am

doon.mok
Member
Registered: May 6, 2015
Posts: 144

Re: Matrix field showing ID in module

Tim,
Were you able to look into this issue?
Thanks

Offline

#5 March 16, 2023 9:56am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: Matrix field showing ID in module

Hi Doon! Sorry for the late reply, I believe this is fixed in 4.5-devel (you'll have to re-save a page with corrupt title data) — there's quite a lot waiting in there for a 4.5.2 release, I should kick that out soon (maybe this weekend).

Offline

#6 March 16, 2023 9:58am

doon.mok
Member
Registered: May 6, 2015
Posts: 144

Re: Matrix field showing ID in module

Thanks for the reply!

Offline

#7 March 24, 2023 11:08am

doon.mok
Member
Registered: May 6, 2015
Posts: 144

Re: Matrix field showing ID in module

Hey Tim,

Just updated to bigtree 4.5.2 and it kind of fixed the issue. Fixed for list field but I also have a custom list field. The custom list field still shows the value instead of description.

Code below for my custom list field.

Draw

$services_module = new services;
$services = $services_module->getAll("title ASC");

$list = array();

foreach($services as $item){
		$list[] = array("value" => $item["id"],"description" => $item["title"]);
}	

$field["options"]["list_type"] = '';
$field["options"]["allow-empty"] = "Yes";
$field["options"]["list"] = $list;

include BigTree::path("admin/field-types/list/draw.php");

Process

$field["output"] = htmlspecialchars($field["input"]);

Do you see anything that I could be doing wrong?
Thanks

Offline

#8 April 5, 2023 2:25pm

doon.mok
Member
Registered: May 6, 2015
Posts: 144

Re: Matrix field showing ID in module

Tim,

I found another issue with the matrix field and list field not showing the selected item. The function processFieldDescription(core/inc/bigtree/admin.php) should have an else statement if list_type is not a "db". That means it is a static list and will still need to get the description.

Something like below added on line 7739

//Get static list description
	else {
		foreach ($field["settings"]["list"] as $list) {
			if($list["value"] == $output) {
				return $list["description"];
				break;
			}
		}
	}
//Get static list description - end

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.