herr rilke Posted October 27, 2024 Share Posted October 27, 2024 thanks @bernhard for this module! it makes my code so much more organized & the content easier to maintain. but i am not able to setup an ajax endpoint: i get a 404 error in return. file lives in /site/templates/ajax/ i am logged in as a superuser. URL has no trailing slash. also the modules settings says: "No endpoints found." what am i doing wrong? PW 3.0.240, RockFrontend 3.21.2, RockPageBuilder 5.8.0 1 Link to comment Share on other sites More sharing options...
bernhard Posted October 27, 2024 Author Share Posted October 27, 2024 On 10/27/2024 at 9:51 AM, herr rilke said: thanks @bernhard for this module! it makes my code so much more organized & the content easier to maintain. Expand Great to hear that! On 10/27/2024 at 9:51 AM, herr rilke said: what am i doing wrong? Expand I can't know if you don't share the exact steps you did. I don't know which file you created. I don't know which url you entered... Maybe it's just a typo! Link to comment Share on other sites More sharing options...
herr rilke Posted October 27, 2024 Share Posted October 27, 2024 hello bernhard, Thank you for your quick response. I found out that the whole thing doesn't work on my local Windows development computer - but it does on my Linux web server. could this be related to file permissions? It's just a "copied version" - copied from Windows to the live server. What would be a starting point? Link to comment Share on other sites More sharing options...
bernhard Posted October 27, 2024 Author Share Posted October 27, 2024 That's a good hint! So maybe we are just missing a normalisation for the path separator somewhere. Can you place bd($rockfrontend) in site/ready.php and tell me the output for ajaxEndpoints? Link to comment Share on other sites More sharing options...
herr rilke Posted October 28, 2024 Share Posted October 28, 2024 good morning @bernhard! this ist bd($rockfrontend) in site/ready.php debug info: ProcessWire\RockFrontend folders: array 0 => 'C:/wamp64/www/qualiguide/site/templates/' 1 => 'C:/wamp64/www/qualiguide/site/assets/' 2 => 'C:/wamp64/www/qualiguide/' liveReload: RockFrontend\LiveReload interval: 1 includeDefaults: array 0 => 'C:/wamp64/www/qualiguide/site/' 1 => 'C:/wamp64/www/qualiguide/RockShell/docs' 2 => 'C:/wamp64/www/qualiguide/RockShell/App' include: array (0) excludeDefaults: array exclude: array (0) autoloadStyles: ProcessWire\WireArray count: 1 items: array 'StylesArray:0' => RockFrontend\StylesArray #447 β¦ autoloadScripts: ProcessWire\WireArray count: 1 items: array 'ScriptsArray:0' => RockFrontend\ScriptsArray #453 β¦ ajaxEndpoints: array (0) Full Object: ProcessWire\RockFrontend addMarkup: null ajax: false ajaxFolders: array '/ajax/' => '/C:/wamp64/www/qualiguide/site/templates/ajax/' alfredCache: ProcessWire\WireData autoloadScripts: ProcessWire\WireArray autoloadStyles: ProcessWire\WireArray contenttype: 'text/html' createManifest: false folders: ProcessWire\WireArray home: ProcessWire\HomePage hasAlfred: false isLiveReload: false js: array (0) langMaps: null latte: null latteWithLayout: null layoutFile: '_main.latte' layoutFolders: ProcessWire\WireArray liveReload: RockFrontend\LiveReload manifest: null noAssets: false noLayoutFile: '' onceKeys: array (0) path: 'C:/wamp64/www/qualiguide/site/modules/RockFrontend/' postCSS: ProcessWire\WireData remBase: 16 scripts: ProcessWire\WireData seo: null sitemapCallback: Closure($page) file: 'C:\wamp64\www\qualiguide\site\modules\RockFrontend\RockFrontend.module.php:2741' sitemapOptions: array (0) styles: ProcessWire\WireData translations: array (0) viewfolders: array (0) data: array useFuel: true _instanceNum: 144 localHooks: array (0) _wireHooks: ProcessWire\WireHooks trackChanges: 0 changes: array (0) _notices: array 'errors' => null 'warnings' => null 'messages' => null _wire: ProcessWire\ProcessWire status: 4 statusNames: array debug: true fuel: ProcessWire\Fuel data: array (35) β¦ lock: array (20) β¦ requiredInterfaces: array (1) β¦ pathSave: 'C:\wamp64\www\qualiguide' fileSave: 'C:/wamp64/www/qualiguide/site/ready.php' updater: unset instanceID: 0 shutdown: ProcessWire\WireShutdown useFuel: true _instanceNum: 6 localHooks: array (0) Link to comment Share on other sites More sharing options...
bernhard Posted October 28, 2024 Author Share Posted October 28, 2024 Thx, could you please try v3.22.2 ? Link to comment Share on other sites More sharing options...
herr rilke Posted October 28, 2024 Share Posted October 28, 2024 thank you! unfortunately the result is still the same π do you need another dump from tracy? Link to comment Share on other sites More sharing options...
bernhard Posted October 28, 2024 Author Share Posted October 28, 2024 @dotnetic as you are on Windows could you please have a look? I can't debug this on Mac... Link to comment Share on other sites More sharing options...
bernhard Posted October 28, 2024 Author Share Posted October 28, 2024 Hey @herr rilke there was an issue with the ajax feature both on windows installations and on subfolder installations. I think they should be fixed now! Please check out v3.23 PS: Thx for your help with the windows path issue @dotnetic, the final fix was a little bit more complicated though π https://github.com/baumrock/RockFrontend/commit/0cf84be630050d212b334e52477d97039823de4f https://github.com/baumrock/RockFrontend/commit/c9fbd2430e166d304cae9af943510cb8a391bcdf 1 Link to comment Share on other sites More sharing options...
herr rilke Posted October 28, 2024 Share Posted October 28, 2024 wow, how great! thanks so much in advance! But I can't yet see the update and import it directly via processwire. Link to comment Share on other sites More sharing options...
bernhard Posted October 28, 2024 Author Share Posted October 28, 2024 Just download it from github and remove /site/modules/RockFrontend and then add the new files there https://github.com/baumrock/RockFrontend/archive/refs/heads/main.zip or https://github.com/baumrock/RockFrontend/releases I've found an issue on my project but let me know if the new version works for you nonetheless. Please use v3.23.1 ! Link to comment Share on other sites More sharing options...
herr rilke Posted October 28, 2024 Share Posted October 28, 2024 allright! i have v3.23.1 and now it shows "/ajax/foo" in module's ajax-settings, but "forbidden" when following that link Link to comment Share on other sites More sharing options...
dotnetic Posted October 28, 2024 Share Posted October 28, 2024 @herr rilke Try to call the path directly instead of clicking the link. http://localhost/path-to-processwire-site/ajax/foo Link to comment Share on other sites More sharing options...
bernhard Posted October 28, 2024 Author Share Posted October 28, 2024 @herr rilke please provide step by step instructions what you did. Provide every file name you created, every file content you put into it, every url you put into your browser. Every important detail about the pw installation (eg is it in a subfolder or not)... @dotnetic just confirmed that it works for him on windows + in subfolder installation 1 Link to comment Share on other sites More sharing options...
herr rilke Posted October 28, 2024 Share Posted October 28, 2024 #@!^$ problem was on my side (forgot that i put it here, yesterday) : <?php // PrΓΌfen, ob der Aufruf per AJAX erfolgt if (!$config->ajax) { http_response_code(403); echo "Forbidden"; exit; } // Beispielantwort echo "Dies ist die Antwort von /ajax/foo"; after deleting the first part, everything works just fine! thank you guys for your support! 2 Link to comment Share on other sites More sharing options...
bernhard Posted October 28, 2024 Author Share Posted October 28, 2024 Great! Have fun π Link to comment Share on other sites More sharing options...
bernhard Posted November 3, 2024 Author Share Posted November 3, 2024 RockFrontend v3.23.2 PW functions like wire() or modules() are now available in latte files π That also means that translations via __(...) now work natively! Several fixes and improvements for the AJAX Endpoints feature Improvements to the quite new field() method Improved consent tools Link to comment Share on other sites More sharing options...
Pavel Radvan Posted January 25 Share Posted January 25 Hi. I have problem with your module. When I click in settings for example on SEO I get Class "DOMDocument" not found error. Here is screenshot: I have dedicated server with PHP 8.4 and MySQL91. Same error is also with RockPdf. Is there aby issue with this ? Let me know how to fix this. Thanks Pavel Link to comment Share on other sites More sharing options...
bernhard Posted January 26 Author Share Posted January 26 Hi @Pavel Radvan these kind of errors are easy to solve by searching the error message in google: https://www.google.com/search?q=class+domdocument+not+found&oq=class+domdocu&gs_lcrp=EgZjaHJvbWUqBwgAEAAYgAQyBwgAEAAYgAQyBggBEEUYOTIICAIQABgWGB4yCAgDEAAYFhgeMggIBBAAGBYYHjIICAUQABgWGB4yCAgGEAAYFhgeMgYIBxBFGDzSAQgzMDg4ajBqN6gCALACAA&sourceid=chrome&ie=UTF-8 Link to comment Share on other sites More sharing options...
Pavel Radvan Posted January 26 Share Posted January 26 Thanks very much for quick response...I looked already before, but now noticed that I do not have php dom extension... After install of it and restart of apache it is OK... So solved... 1 Link to comment Share on other sites More sharing options...
bernhard Posted February 2 Author Share Posted February 2 Just released v5.0.0 of RockFrontend LiveReload has been removed (moved to RockDevTools) styles() and scripts() feature has been removed (moved to RockDevTools) RockDevTools is unfortunately not a drop-in-replacement as we had to change how assets are handled and included into the final website markup. The good news is that RockDevTools also supports merging multiple files to one and it will also work with template cache enabled π 1 Link to comment Share on other sites More sharing options...
Stefanowitsch Posted February 3 Share Posted February 3 @bernhard I stumbled upon the release of RockDevTools in your newsletter. I mainly used the LiveReload and Asset Minification feature of RockFrontend (if not only those features :-)) Is RockFrontend Deprecated in the near future and would you advice switching to RockDevTools in that case? Link to comment Share on other sites More sharing options...
bernhard Posted February 3 Author Share Posted February 3 On 2/3/2025 at 9:07 AM, Stefanowitsch said: Is RockFrontend Deprecated in the near future and would you advice switching to RockDevTools in that case? Expand RockFrontend will not be deprecated. I need it for every project. I just moved styles() and scripts() and LiveReload to another module. Regarding asset minification: I need that on almost every module that I create. I have some CSS or LESS files in the module's /src folder and I want to compile them to CSS / minified CSS. I did that using RockFrontend, which is not really what the module was built for. Now this is done with RockDevTools. Same for LiveReload. I need LiveReload for development, both on the frontend and on the backend. All the time. But only on my development machine, not on production. That's how RockDevTools works now. 1 Link to comment Share on other sites More sharing options...
Stefanowitsch Posted February 3 Share Posted February 3 @bernhard Can you give me an advice on this? Following the code examples here https://www.baumrock.com/en/processwire/modules/rockdevtools/docs/assets/ I put this code here inside my <head> <?= $rockfrontend()->styleTag('/site/templates/styles/styles.min.css'); ?> <?= $rockfrontend()->scriptTag('/site/templates/scripts/scripts.min.js', 'defer'); ?> I then get this error message in the frontend: ArgumentCountError Too few arguments to function ProcessWire\WireData::__invoke(), 0 passed in /var/www/html/site/templates/elements/_head.php on line 18 and exactly 1 expected searchβΊ Line 18 is this line here: <?= $rockfrontend()->styleTag('/site/templates/styles/styles.min.css'); ?> Link to comment Share on other sites More sharing options...
bernhard Posted February 3 Author Share Posted February 3 On 2/3/2025 at 9:56 AM, Stefanowitsch said: $rockfrontend() Expand That's wrong. It should either be $rockfrontend or rockfrontend() 2 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