VvvebJs icon indicating copy to clipboard operation
VvvebJs copied to clipboard

ReferenceError: deleteUrl is not defined?

Open arievanden opened this issue 1 year ago • 2 comments

The editor is working great. I do have a problem with the calls for delete, rename, etc.

deleteUrl seems to be declared from editor.html

let deleteUrl = 'save.php?action=delete';

but from builder.js, it returns: ReferenceError: deleteUrl is not defined. What am I missing?

deletePage: function(element, e) { ... fetch(deleteUrl, { method: "POST", body: new URLSearchParams({file:page.file}) }) .then((response) => { if (!response.ok) { return Promise.reject(response); } return response.text() })

arievanden avatar Oct 22 '24 22:10 arievanden

I'm unable to reproduce this bug.

Can you please check if there is another js error before this one that might invalidate `let deleteUrl' declaration?

Can you also check on demo https://www.vvveb.com/vvvebjs/editor.html to rule out any browser issues?

givanz avatar Oct 24 '24 11:10 givanz

I'm calling the libs from Yii2, and after testing it seems that $this->registerJs() breaks the variables. Not sure how, but it does. Tried different registerJs() params with the same result. The solution is to just use

arievanden avatar Oct 28 '24 10:10 arievanden