kirby-dreamform icon indicating copy to clipboard operation
kirby-dreamform copied to clipboard

Title of custom actions log entry is unreadable

Open ovenum opened this issue 9 months ago • 1 comments
trafficstars

When setting the the title of a custom Dreamform action log entry, the title prop passed is encoded with encodeURIComponent. This will break template string rendering and can make the title unreadable.

class CustomAction extends Action {
  public function run(): void {
    $this->log(
      [
        'template' => [
          'title' => 'Custom Action Title'
        ]
      ], 
      type: 'info',
      icon: 'icon',
      title: 'Template Test {{ title }}'
    );
  }
}

Thie will create a log entry with an encoded title. Image

The encoding is happening in BaseEntry.vue https://github.com/tobimori/kirby-dreamform/blob/fdd70f9f8d9b451badd3607379bed738928ff4a4/src/components/log/EntryBase.vue#L23-L27

I'm not sure why encodeURIComponent is used here but removing it fixed the issue.

ovenum avatar Feb 18 '25 17:02 ovenum

idk why I added it tbh :D thanks

tobimori avatar Feb 19 '25 12:02 tobimori