Product extrafield in PDF invoice

With line
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);

Answer:
What error? => crash PDF, HTTP ERROR 500
What is the extra field configuration ? => facture (facture_cust_extrafields.php) / Select lis:
1,lista1
2,lista2
3,lista3
Can you share the full model ? => (pdf_crabe.modules.php)

				}
			}
			
			// EXTRAFIELD test Select list *******************************
                    $object->fetch($rowid);
                    $object->fetch_optionals($rowid,$extralabels);
                    $extrafields = new ExtraFields($db);
                  $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);

                    $pdf->MultiCell(0, 3, 'LISTA: '.$outputlangs->convToOutputCharset($object->array_options['options_lista']), 0, 'L', 0);

// $pdf->MultiCell(0, 3, 'LISTA: '.$extrafields->showOutputField(‘lista’, $object->array_options[‘options_lista’]), 0, ‘L’, 0);
//*******************************

			// Display notes
			$notetoshow = empty($object->note_public) ? '' : $object->note_public;

With code:

    			// EXTRAFIELD test Select list *******************************
                        $object->fetch($rowid);
                        $object->fetch_optionals($rowid,$extralabels);
                        $extrafields = new ExtraFields($db);
//                      $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);

                        $pdf->MultiCell(0, 3, 'LISTA: '.$outputlangs->convToOutputCharset($object->array_options['options_lista']), 0, 'L', 0);
//                      $pdf->MultiCell(0, 3, 'LISTA: '.$extrafields->showOutputField('lista', $object->array_options['options_lista']), 0, 'L', 0);
                //*******************************

Momentarily I have solved, modifying the options in the selection list
lista1, lista1
lista2, lista2
lista3, lista3

So the result in pdf is
LISTA: lista2

[image]pdf_ok_lista2

Could you check the logs to see what is the error ?

I´m test in commande now, and is OK

        // EXTRAFIELD test Select list (selectlist)*******************************
                $extrafields = new ExtraFields($db);
                $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
                $object->fetch($rowid);
                $object->fetch_optionals($rowid,$extralabels);

		$pdf->MultiCell(100, 3, 'LISTA: '.$extrafields->showOutputField('selectlist', $object->array_options['options_selectlist']), 0, 'R', 0);

    //*******************************

Print PDF:
LISTA: lista22222 (valor)

Thank u!