Merge pull request #14404 from snipe/fixes/Uninitialized-string-offset-0-in-labels
Fixed uninitialized offset in labels in new label engine
This commit is contained in:
commit
3fdee881f9
1 changed files with 6 additions and 3 deletions
|
@ -160,18 +160,21 @@ class DefaultLabel extends RectangleSheet
|
||||||
$textY += $this->textSize + self::TEXT_MARGIN;
|
$textY += $this->textSize + self::TEXT_MARGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fields
|
// Render the selected fields with their labels
|
||||||
$fieldsDone = 0;
|
$fieldsDone = 0;
|
||||||
if ($fieldsDone < $this->getSupportFields()) {
|
if ($fieldsDone < $this->getSupportFields()) {
|
||||||
// dd($record->get('fields'));
|
|
||||||
foreach ($record->get('fields') as $field) {
|
foreach ($record->get('fields') as $field) {
|
||||||
|
|
||||||
|
// Actually write the selected fields and their matching values
|
||||||
static::writeText(
|
static::writeText(
|
||||||
$pdf, $field['label'][0]. ': ' . $field['value'],
|
$pdf, (($field['label']) ? $field['label'].' ' : '') . $field['value'],
|
||||||
$textX1, $textY,
|
$textX1, $textY,
|
||||||
'freesans', '', $this->textSize, 'L',
|
'freesans', '', $this->textSize, 'L',
|
||||||
$textW, $this->textSize,
|
$textW, $this->textSize,
|
||||||
true, 0
|
true, 0
|
||||||
);
|
);
|
||||||
|
|
||||||
$textY += $this->textSize + self::TEXT_MARGIN;
|
$textY += $this->textSize + self::TEXT_MARGIN;
|
||||||
$fieldsDone++;
|
$fieldsDone++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue