cakephp-datatables icon indicating copy to clipboard operation
cakephp-datatables copied to clipboard

Cake v4 issues and workaround.

Open alanapplyby opened this issue 3 years ago • 0 comments

I have noted a few users have reported an issue when using this plugin with Cake v4. I have done a little investigation my side side and found the following.

The following line seems to cause an issue:

$js .= $this->Html->scriptBlock($code, ['block' => true]);

Specifically the block true param. Changing this to false fixes the issue, or else leaving it as true then in the template:

<?= $this->DataTables->table('requests', $options, ['class' => 'table table-striped']); ?>
<?= $this->fetch('script'); ?>

It is not clear to me why this works though and if it is an acceptable approach - hope this helps.

alanapplyby avatar Sep 22 '21 10:09 alanapplyby