givanz / Vvveb

Powerful and easy to use cms to build websites, blogs or ecommerce stores.
https://www.vvveb.com
GNU Affero General Public License v3.0
384 stars 82 forks source link

Error after try 'save as reusable' #78

Closed lilianzzz closed 9 months ago

lilianzzz commented 9 months ago

Error after try 'save as reusable' If additional information is required, I am ready to provide

Warning: file_put_contents(/home/d/dissokdf/techdeer.ru/public_html/public/themes/blink-coming-soon/blocks/reusable/header.html): Failed to open stream: No such file or directory in /home/d/dissokdf/techdeer.ru/public_html/admin/controller/editor/editor.php on line 327 {"success":false,"message":"Error saving!"}
givanz commented 9 months ago

Thanks for the bug report.

This theme does not come with default blocks and the folder for blocks is missing.

Can you please replace https://github.com/givanz/Vvveb/blob/master/admin/controller/editor/editor.php#L325

@mkdir($folder);

with

@mkdir($folder, 0755 & ~umask(), true);

If it still fails to create the folders try to create the blocks/reusable folders inside /public/themes/blink-coming-soon/ manually and set write permission.

lilianzzz commented 9 months ago

image

@mkdir($folder, 0755 & ~umask(), true);

It helped, the files are being created. but in the editor after refreshing the page they disappear image

givanz commented 9 months ago

Thanks for feedback, to fix this issue please redownload latest.zip and update the files on the server.

Changed files under /admin/controller/editor and /system but update all files if possible.

You need to save a new block/section to regenerate the list.

lilianzzz commented 9 months ago

It seems that the project was transferred correctly - I left only the database and config/sites.php (it also changed slightly) and the theme from public/themes/blink-coming-soon (with cleared block/section) (maybe I didn't transfer the changes correctly?)

but the error persists - it still does not display blocks when updating. However, it no longer saves the file to the /public/themes/blink-coming-soon/blocks/reusable directory

image

Great, the css is not reset, although now the font size and other parameters from the side menu do not change =)

vivaldi_fO00v8zPCz

Upd -

I tried it in a clean environment - bug is still reproduced with the same notification

givanz commented 9 months ago

Sorry this is caused by a small change that I made and didn't test.

Please change in admin/controller/editor/reusable.php line 58

return DIR_THEMES . DS . $this->request->get['theme'] ?? Sites::getTheme() ?? 'default';

with

return DIR_THEMES . DS . ($this->request->get['theme'] ?? Sites::getTheme() ?? 'default');

I also updated the file in latest.zip.

No database change is needed, you can skip /config folder when updating to keep site settings like selected theme.

lilianzzz commented 9 months ago

Great! everything works now =) Thanks