Skip to content

fix(labels): correct entity label to use entity data instead of stale waypoint/order fallbacks#280

Open
janni1288 wants to merge 1 commit into
fleetbase:mainfrom
janni1288:fix/entity-label-stale-fallbacks
Open

fix(labels): correct entity label to use entity data instead of stale waypoint/order fallbacks#280
janni1288 wants to merge 1 commit into
fleetbase:mainfrom
janni1288:fix/entity-label-stale-fallbacks

Conversation

@janni1288

Copy link
Copy Markdown

What

Fixes the entity label template ('entity-label.php'), which was copy-pasted from 'waypoint-label.php' and still referenced '$waypoint'/'$order', variables that are never passed to 'Entity::label()'.

Why

Related to #182 - while investigating single-entity label generation, found that the existing 'type=entity' label endpoint renders a broken title ("Waypoint Label" instead of the correct label) and contains dead/unreachable fallback code ('$order->trackingNumber') that would throw if '$trackingNumber' were never empty.

Changes

  • Title now correctly reflects the entity instead of a waypoint
  • QR code and barcode fallbacks use '$entity->qr_code' / '$entity->barcode' instead of the undefined '$order'
  • Tracking number fallback uses '$entity->public_id'

Testing

  • Verified locally by rendering 'Entity::label()' via Tinker - title now shows correctly
  • Existing test 'LabelIdPdfRenderingTest' still passes

Related to #182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant