I am not sure what is going on or what to do or how to troubleshoot this further.
I made here a screen recording of the issue:
I followed the documentation and created a custom element “custom-element.php” that was working perfectly
It works, shows up in the editor, I customize it, use it, it loads up on the front end as expected.
I customize it for a while, then it starts saying “custom element doesn’t exist” on the Bricks Editor and stops showing up in the elements panel.
I assume I must have broken the code, so revert the changes back to a working code but it doesn’t fix it. it still says “custom element doesn’t exist”.
No matter what I do, it always says “custom element doesn’t exist”
I create a brand new element with a different name “custom-element-2.php”
Copy paste the code exactly from “custom-element.php” to “custom-element-2.php” only updating the name.
This fixes the issue and now the code works.
After some time ( some 48h ) as I return to work back on it, it’s saying “custom-element-2 doesn’t exist”.
I copy paste the code again into “custom-element-3.php” and now it works again.
I’m really not sure what is going on, it’s like Bricks remembers the name of the custom element that stops working, even if it has working code, and it chooses to never load it again?
Not sure if it matters but I’m using Filezilla to access the server files and then editing them with notepad (although I code with notepad++).
Unfortunately, I cannot reproduce the issue. Please send temporary login credentials and a link to this thread to help@bricksbuilder.io using the email address you used during the purchase.
Thanks @timmse !
I have just sent the email but meanwhile I think I have found out what could be going wrong,
After trying to edit the files through wordpress Theme Editor I noticed most of my custom-element.php files are empty here.
And also have a
" You need to make this file writable before you can save your changes. See Changing File Permissions for more information."
The thing is, I have accessed through Filezilla and gave all permissions to the files (777) even applied it to the main “bricks-child” theme folder file and to all subdirectories and files, but for some reason it still doesn’t work?
Although after knowing this, for new files “custom-element.php” I have created,
I have immidiately went ahead and changed their file permissions to 777
and those are now editable through the wordpress control panel in the Theme Editor menu, so I’m not sure if this might have fixed it, but if it has fixed (and it won’t automatically somehow revert back or stop working like it was happening previously) I will update the thread here!
Update:
The same issue happened
Today I get to my custom.php element files looking at them from the wordpress dashboard in the “theme editor” menu, and they are all empty with the message " You need to make this file writable before you can save your changes. See Changing File Permissions for more information."
I don’t get how.
The thing is, changing it manually back to 777 and adding all permissions does not fix the issue. Even after saving the file again with the code in it, it still displays as empty from the wordpress theme editor dashboard
I just logged in to your site and can confirm that you still have a permissions issue with the elements directory. This isn’t a bug with Bricks but a file permissions problem. I’ll get in touch with you over email to help direct you in the right direction.
Thank you very much Charaf and Timmse for your help in locating the source of this issue and finally fixing it.
I am leaving here some more details in case someone else encounters te same issue in the future:
I am using runcloud to manage my wordpress installations. I was using Filezilla to access the server folders and create new files ( the custom elements). The issue seems to be I was logged in to root user, which even though the file permissions would be right, for some reason because they were created by root user then Bricks (wordpress installation is made through a different user, such as default runcloud user) would not be able to access these files.
The trick is to login to the correct user that you used for that wordpress installation (by default on runcloud it is “runcloud” user) and make the changes through that user. My mistake is I was logged in through “root”.