neophron Posted February 27 Share Posted February 27 Hi, I'm desperately trying to install RPB. PW 3.0.244 (), RPB 6.2.0 with php 8.2. I followed all instructions (https://www.baumrock.com/en/processwire/modules/rockpagebuilder/docs/setup/). This is the frontend: What the… Error: Exception: Method RockFrontend::styles does not exist or is not callable in this context (in wire/core/Wire.php line 563) #0 wire/core/Wire.php (419): Wire->___callUnknown('styles', Array) #1 wire/core/WireHooks.php (968): Wire->_callMethod('___callUnknown', Array) #2 wire/core/Wire.php (484): WireHooks->runHooks(Object(RockFrontend), 'callUnknown', Array) #3 wire/core/Wire.php (487): Wire->__call('callUnknown', Array) #4 site/templates/_init.php (9): Wire->__call('styles', Array) #5 wire/core/TemplateFile.php (314): require('/Users/neophron...') #6 wire/core/Wire.php (413): TemplateFile->___render() #7 wire/core/WireHooks.php (968): Wire->_callMethod('___render', Array) #8 wire/core/Wire.php (484): WireHooks->runHooks(Object(TemplateFile), 'render', Array) #9 wire/modules/PageRender.module (581): Wire->__call('render', Array) #10 wire/core/Wire.php (416): PageRender->___renderPage(Object(HookEvent)) #11 wire/core/WireHooks.php (968): Wire->_callMethod('___renderPage', Array) #12 wire/core/Wire.php (484): WireHooks->runHooks(Object(PageRender), 'renderPage', Array) #13 wire/core/WireHooks.php (1094): Wire->__call('renderPage', Array) #14 wire/core/Wire.php (484): WireHooks->runHooks(Object(HomePage), 'render', Array) #15 wire/modules/Process/ProcessPageView.module (193): Wire->__call('render', Array) #16 wire/modules/Process/ProcessPageView.module (114): ProcessPageView->renderPage(Object(HomePage), Object(PagesRequest)) #17 wire/core/Wire.php (416): ProcessPageView->___execute(true) #18 wire/core/WireHooks.php (968): Wire->_callMethod('___execute', Array) #19 wire/core/Wire.php (484): WireHooks->runHooks(Object(ProcessPageView), 'execute', Array) #20 index.php (55): Wire->__call('execute', Array) #21 {main} This error message was shown because: you are logged in as a Superuser. Error has been logged. I'm installing the Rockfrontend and Rockmigrations modules by »Add Module from directory«. Since the RPB zip file is too big for the »Add Module from upload«, I'm uploading it to the modules directory. Everything works fine in the backend. I'm afraid, that I missed something, cause meanwhile there are differences in the installation video and the latest version. Like the field »rockpagebuilder_blocks« is already attached to the home.php. Link to comment Share on other sites More sharing options...
bernhard Posted February 27 Share Posted February 27 Hey @neophron sorry for the trouble. But no reason to be desperate - I'm here to help and this one will be quite easy to fix 🙂 Background: Unfortunately I had to introduce a breaking change with how assets are managed and injected. In the old version I relied on RockFrontend's styles() and scripts() methods to inject styles/scripts into the frontend. The new version leaves that up to the user. This means he/she has more control over their final frontend markup (no automatically injected styles and scripts) but it also means more to do during the initial setup. On 2/27/2025 at 4:36 PM, neophron said: #4 site/templates/_init.php (9): Wire->__call('styles', Array) Expand Can you share your _init.php please? Especially around line 9. PM if you don't want to share it here. 1 Link to comment Share on other sites More sharing options...
neophron Posted February 27 Author Share Posted February 27 On 2/27/2025 at 6:04 PM, bernhard said: Hey @neophron sorry for the trouble. But no reason to be desperate - I'm here to help and this one will be quite easy to fix 🙂 Background: Unfortunately I had to introduce a breaking change with how assets are managed and injected. In the old version I relied on RockFrontend's styles() and scripts() methods to inject styles/scripts into the frontend. The new version leaves that up to the user. This means he/she has more control over their final frontend markup (no automatically injected styles and scripts) but it also means more to do during the initial setup. Can you share your _init.php please? Especially around line 9. PM if you don't want to share it here. Expand Hi Bernhard, this is the _init.php: <?php namespace ProcessWire; /** @var RockFrontend $rockfrontend */ $htmlLang = "de"; $rockfrontend->styles() ->add('/site/templates/uikit/src/less/uikit.theme.less') ->add('/site/modules/RockFrontend/less/defaults.less') ->addDefaultFolders() ->minify(!$config->debug); $rockfrontend->scripts() ->add('/site/templates/uikit/dist/js/uikit.min.js') ->add('/site/templates/scripts/main.js', 'defer') ->minify(!$config->debug); $seo = $rockfrontend->seo(createManifest: false) ->title($page->title . " | example.com"); Link to comment Share on other sites More sharing options...
bernhard Posted March 1 Share Posted March 1 Hey @neophron thx for the update. You have old ->styles() and ->scripts() calls in that file that you have to remove. I tried to explain what to do and the reason for the breaking change as good as I can here: https://www.baumrock.com/en/processwire/modules/rockfrontend/docs/asset-tools/ I'm also updating the rockfrontend site profile that you can use for inspiration. Does that help? 1 Link to comment Share on other sites More sharing options...
neophron Posted March 2 Author Share Posted March 2 On 3/1/2025 at 10:48 AM, bernhard said: Hey @neophron thx for the update. You have old ->styles() and ->scripts() calls in that file that you have to remove. I tried to explain what to do and the reason for the breaking change as good as I can here: https://www.baumrock.com/en/processwire/modules/rockfrontend/docs/asset-tools/ I'm also updating the rockfrontend site profile that you can use for inspiration. Does that help? Expand Does it mean, that if someone, who just purchased this module and starts with a fresh PW installation, would face the same issues? I'm asking, cause I installed in fresh PW installation your 3 modules. Here' what happened: I installed the 3 modules and activated all example blocks. The home.php contains only <?= $rockpagebuilder->render(true) ?> In the frontend I was able to choose and fill a gallery, but there was no »save« button. So I had to create a gallery from the backend. The frontend showed me only the markup, cause there was no profile activated. I installed the Beginner Profile together with the latest uikit package. Since my php knowledge is more basic, what shall be inside the round brackets ->add(...)? The template/_init.php has this: // site/templates/_init.php if ($config->rockdevtools) { $devtools = rockdevtools(); // compile all less files to CSS $devtools->assets() ->less() ->add(...) ->save('/site/templates/src/.styles.css'); // merge and minify css files $devtools->assets() ->css() ->add(...) ->save('/site/templates/dst/styles.min.css'); // merge and minify JS files $devtools->assets() ->js() ->add(...) ->save('/site/templates/dst/scripts.min.js'); } The frontend shows me: Oops… Error: Exception: This feature has been removed with version 5 - please see upgrade guide at baumrock.com/rf-upgrade5 (in site/modules/RockFrontend/RockFrontend.module.php line 2794) #0 site/templates/_main.php (6): RockFrontend->styles() #1 wire/core/TemplateFile.php (340): require('/www/htdocs/w01...') #2 wire/core/Wire.php (413): TemplateFile->___render() #3 wire/core/WireHooks.php (968): Wire->_callMethod('___render', Array) #4 wire/core/Wire.php (484): WireHooks->runHooks(Object(TemplateFile), 'render', Array) #5 wire/modules/PageRender.module (581): Wire->__call('render', Array) #6 wire/core/Wire.php (416): PageRender->___renderPage(Object(HookEvent)) #7 wire/core/WireHooks.php (968): Wire->_callMethod('___renderPage', Array) #8 wire/core/Wire.php (484): WireHooks->runHooks(Object(PageRender), 'renderPage', Array) #9 wire/core/WireHooks.php (1094): Wire->__call('renderPage', Array) #10 wire/core/Wire.php (484): WireHooks->runHooks(Object(Page), 'render', Array) #11 wire/modules/Process/ProcessPageView.module (193): Wire->__call('render', Array) #12 wire/modules/Process/ProcessPageView.module (114): ProcessPageView->renderPage(Object(Page), Object(PagesRequest)) #13 wire/core/Wire.php (416): ProcessPageView->___execute(true) #14 wire/core/WireHooks.php (968): Wire->_callMethod('___execute', Array) #15 wire/core/Wire.php (484): WireHooks->runHooks(Object(ProcessPageView), 'execute', Array) #16 index.php (55): Wire->__call('execute', Array) #17 {main} This error message was shown because: you are logged in as a Superuser. Error has been logged. So, I'm installing the latest versions of these modules. After the setup an error appears with a notice, that I have to read the explanations on line 2794 how to change the _init.php. Or shall I install also the new rockdevtools module? I'm not an expert in module coding at all, but this solution is not very user friendly. Link to comment Share on other sites More sharing options...
zoeck Posted March 2 Share Posted March 2 It looks as if you are still using the old function in the _main.php file (line 6). At least that's what it says in the error message site/templates/_main.php (6): RockFrontend->styles() 1 Link to comment Share on other sites More sharing options...
neophron Posted March 2 Author Share Posted March 2 On 3/2/2025 at 11:06 AM, zoeck said: It looks as if you are still using the old function in the _main.php file (line 6). At least that's what it says in the error message site/templates/_main.php (6): RockFrontend->styles() Expand I didn't touched the _main.php. Rockfrontend changed it: <?php namespace ProcessWire; /** @var RockFrontend $rockfrontend */ $rockfrontend->styles() ->add('/site/templates/uikit/dist/css/uikit.min.css') ->addDefaultFolders(); // autoload styles in sections, partials, etc $rockfrontend->scripts() ->add('/site/templates/uikit/dist/js/uikit.min.js'); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <?= $rockfrontend->renderLayout($page) ?> </body> </html> Link to comment Share on other sites More sharing options...
bernhard Posted March 7 Share Posted March 7 On 3/2/2025 at 3:14 PM, neophron said: I didn't touched the _main.php. Rockfrontend changed it: Expand Hey @neophron RockFrontend doesn't change the _main.php file. I guess you mean the RockFrontend Site Profile?! Whatever. As I told you at the very beginning you need to remove all styles() and scripts() calls and add assets manually. How you do that is up to you. You can either add the script/style tags manually to your main markup file or you can use RockDevTools. It's really up to you. But unless you remove all styles() and script() calls your system will not work and is not expected to work. There might be some inconsistencies with the site profile or other references to that old concept. I'm sorry for that and I'm trying my best to remove all those outdated informations. For that it would help to get the exact steps you took to get where you are. I understand that this might be frustrating, but please also understand that it is frustrating for me to try to help but don't get proper information and searching in the dark for issues that I don't see. What is that status on your end? Did you get it working already? What did you try to make it work? I'm very busy until end of next week so it would be nice to get an as detailed report as possible. Alternatively I can offer you that you send me your project and I set everything up so that it works. 1 Link to comment Share on other sites More sharing options...
neophron Posted March 11 Author Share Posted March 11 On 3/7/2025 at 2:22 PM, bernhard said: Hey @neophron RockFrontend doesn't change the _main.php file. I guess you mean the RockFrontend Site Profile?! Whatever. As I told you at the very beginning you need to remove all styles() and scripts() calls and add assets manually. How you do that is up to you. You can either add the script/style tags manually to your main markup file or you can use RockDevTools. It's really up to you. But unless you remove all styles() and script() calls your system will not work and is not expected to work. There might be some inconsistencies with the site profile or other references to that old concept. I'm sorry for that and I'm trying my best to remove all those outdated informations. For that it would help to get the exact steps you took to get where you are. I understand that this might be frustrating, but please also understand that it is frustrating for me to try to help but don't get proper information and searching in the dark for issues that I don't see. What is that status on your end? Did you get it working already? What did you try to make it work? I'm very busy until end of next week so it would be nice to get an as detailed report as possible. Alternatively I can offer you that you send me your project and I set everything up so that it works. Expand Hi Bernhard, thanks for your reply. Right now I'm involved in different jobs. As soon as I'm finished, I'll continue with my tests and let you know. 1 Link to comment Share on other sites More sharing options...
bernhard Posted Thursday at 11:18 AM Share Posted Thursday at 11:18 AM @neophron sent me his project and I fixed it for him. Maybe this is helpful for others as well: If you get an error message like this, please read the instructions and also check the trace of the request. It will tell you WHERE the call happened that caused the error: Aw shucks… Error: Exception: This feature has been removed with version 5 - please see upgrade guide at baumrock.com/rf-upgrade5 (in site/modules/RockFrontend/RockFrontend.module.php line 2794) #0 site/templates/_init.php (9): RockFrontend->styles() ... In this case it shows us that we have a call to RockFrontend's style() method on line 9 of _init.php! So I basically removed that and it worked. 1 Link to comment Share on other sites More sharing options...
neophron Posted yesterday at 11:36 AM Author Share Posted yesterday at 11:36 AM On 3/20/2025 at 11:18 AM, bernhard said: @neophron sent me his project and I fixed it for him. Maybe this is helpful for others as well: If you get an error message like this, please read the instructions and also check the trace of the request. It will tell you WHERE the call happened that caused the error: Aw shucks… Error: Exception: This feature has been removed with version 5 - please see upgrade guide at baumrock.com/rf-upgrade5 (in site/modules/RockFrontend/RockFrontend.module.php line 2794) #0 site/templates/_init.php (9): RockFrontend->styles() ... In this case it shows us that we have a call to RockFrontend's style() method on line 9 of _init.php! So I basically removed that and it worked. Expand Thanks, now it works 🙂 1 Link to comment Share on other sites More sharing options...
bernhard Posted yesterday at 11:38 AM Share Posted yesterday at 11:38 AM Great 🙂 Thx for letting me know and I hope you enjoy the journey from now on! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now