Jump to content

bernhard

Members
  • Posts

    6,312
  • Joined

  • Last visited

  • Days Won

    318

Everything posted by bernhard

  1. Ok great thx @MarkE can you track it down further or do you have a reproducible steps of actions that I can take to debug it myself?
  2. Maybe this? https://processwire.com/modules/pageimage-remove-variations/
  3. I think you just need to set the property "rockcalculator" of your field (not inputfield!) before it is rendered. That should be possible from your code without any hooks. Maybe like this? <?php $f = $this->modules->get("InputfieldText"); if(wire()->modules->isInstalled('RockCalculator')) { // set the rockcalculator here // $f->attr("data-rockcalculator", 6); //6 digit precision $f->notes = __("Numeric or math formula"); $f->hasField->rockcalculator = true; } else { $f->notes = __("Numeric"); $f->precision = 6; $f->attr('type', "number"); $f->attr('step', "any"); }
  4. I've also had those errors lately... Not sure what is the reason because it have been bigger projects with lots of modules under heavy development and also on latest DEV which had some issues lately. Do you have any other of my modules installed? RockFrontend? RockMigrations?
  5. fyi @MarkE the images in your github readme seem to be broken..
  6. RockFrontend got some really cool updates over the last days thx to some inputs from @gebeer! The latest additions improve SVG rendering and finally I found a way to get rid of the need to add |noescape to every alfred() call in latte files ?? SVGs You can use the render() method to write SVG markup directly to your template file: // latte // icon is in /site/templates/img/icon.svg {$rockfrontend->render('img/icon.svg')} // php echo $rockfrontend->render('img/icon.svg'); You can even provide variables to replace, so you can create completely dynamic SVGs with custom rotation angles or colors etc... {$rockfrontend->render('img/triangle.svg', [ // replace the {rotate} tag in the svg markup 'rotate'=>45, 'color'=>'blue', ])} // add the replacement tag to your svg file // img/triangle.svg <svg style="transform: rotate({rotate}deg); border: 2px solid {color};">... PS: You can also use $rockfrontend->svg('img/triangle.svg') if you want ?
  7. It seems you are trying to save a NullPage. Your $pages->get(41) will return a NullPage if no page with ID 41 exists. So a setAndSave() will fail. If you set $config->debug = true in your config.php you should maybe get errors displayed instead of a non-saying error 500. You can only reset passwords of a user that exists. So your first challenge is to get the name or id of the superuser. You can also inspect the DB table "pages" if you have access to your DB Users have templates_id=3
  8. Would be interested to hear what the other 10% are and why they are not ProcessWire as well ? Factual question - no offense in any way.
  9. I'm not using yaml at all. That was just a quick test because many were asking for it. I'm still not convinced. For the same reasons as why I'm not convinced with your approach (at least how I'm understanding it). I guess the reason why our files are similar is no surprise, because our modules describe what PW has to do and of course the data structure of PW is the same for your module and mine. https://processwire.com/talk/topic/26635-add-better-configuration-for-fields-and-templates-and-make-them-version-controllable/?do=findComment&comment=220791 The point here is: I know that when it comes to migrations the "standard" way of doing it is to provide an upgrade() and a downgrade() code. I've started that way too (back in Jan/2019 https://github.com/BernhardBaumrock/RockMigrations/blob/a2b90ba4fc1aa2b4a6c4e1dc976ca644ae492888/.RockMigrationsDemoModule/RockMigrations/0.0.1.php ) Since then it turned out that writing downgrade methods is just a waste of time. I've never - really: never - had the need for a downgrade since then. Usually when developing and when reverting thins a simple db-pull from the staging system is enough and all the changes are gone. No need for a downgrade. If changes have already been pushed to staging/production then of course this method does not work. But the link above shows how easy it is to solve, eg by simply adding this to my migration: $rm->deleteField('my-old-field-that-is-not-needed-any-more') Some may call it an antipattern - but ProcessWire as a whole is a single antipattern and I really like that ? https://processwire.com/talk/topic/26635-add-better-configuration-for-fields-and-templates-and-make-them-version-controllable/?do=findComment&comment=220829 It's not really about liking it or not. It's just not usable for me. Why? It's simple. I like to do things in a modular, reusable way. Without any user input (beside maybe clicking an install button). I like to build modules that can be installed on many websites. And I like to deploy my websites on staging and on production automatically. Or to push changes to a project where another developer just has to do git pull and it will work. How would your module/approach do that? In case you hadn't realised, there is extensive documentation of the module at https://metatunes.github.io/DbMigrate/help.html. So you don't need to install and use the module to get an understanding of what it does. Specifically as regards running code on migrations, see the following sections: https://metatunes.github.io/DbMigrate/help.html#snippets and https://metatunes.github.io/DbMigrate/help.html#hooks. I was confused because you wrote a specific question in my module's thread that I tried to understand, that's why I was asking for a more detailed explanation. All I got was a RTFM-like answer. But you were right, I did not know about your docs. Looks like you have put a lot of effort into them. Still I don't get how you are actually working with the module. And that was what I was asking for. To understand and maybe find a way to get the best of both worlds. If you want to add some kind of yaml recorder or migrations GUI into RockMigrations I'm happy to pull that or to assist where I can. I'm just not adding it myself unless someone pays me to do it. Simply because I'm at the moment 90% sure that such a tool will not work for me and therefore I don't need it. But the "migrations code" inspector field is a feature coming from a push by the community, so maybe there'll be other useful things along the way as well.
  10. You can do that: if($modules->isInstalled('YourModule')) { $m = $modules->get('YourModule'); echo $m->foo(); }
  11. If anything tries to access your module than it will auto-install it. Maybe you have a $modules->get('YourModule') somewhere in your frontend?
  12. Hey @Pavel Tajduš thx for the report. I guess it's a windows issue. It should just convert those paths to urls automatically. @zoeck has no problems on windows I think? For debugging can you please inspect what url it sets here: https://github.com/baumrock/RockFrontend/blob/64dfc3b2325185fa9dbba8bc50411a7c37c92990/Asset.php#L19 I'm already using Paths::normalizeSeparators() in getFile(), but maybe there is some other issue? https://github.com/baumrock/RockFrontend/blob/64dfc3b2325185fa9dbba8bc50411a7c37c92990/RockFrontend.module.php#L480 Let me know what you find!
  13. Hm... Just had the idea that it would be nice to have the domain processwire.rocks for my channel with that name... My channel was created on 21.07.2022, the domain is taken by someone else and has been registered on 06.08.2022... coincidence? who.is leads to namesilo, which shows a "try to buy" button... https://www.namesilo.com/domain/search-domains?query=processwire.rocks that.sucks Any ideas for a better name + domain are welcome! I guess I'll have to register a domain BEFORE starting the next channel ?
  14. I'd also be concerned. I've never seen that. No idea what you did..
  15. Everything working as expected now, thx @ryan ?
  16. Turns out it is not an issue with my modules... I've installed a fresh installation of the latest PW. I have even done that manually to make sure it has nothing to do with the installation process of RockShell. When I try to edit the "Home" page and rename the title from "Home" to "Home2" the page saves but the change is not saved: This is my config - maybe it makes a difference which settings to use on install? <?php namespace ProcessWire; if(!defined("PROCESSWIRE")) die(); /** @var Config $config */ /*** SITE CONFIG *************************************************************************/ $config->useFunctionsAPI = true; $config->usePageClasses = true; $config->useMarkupRegions = true; $config->prependTemplateFile = '_init.php'; $config->appendTemplateFile = '_main.php'; $config->templateCompile = false; /*** INSTALLER CONFIG ********************************************************************/ $config->dbHost = 'db'; $config->dbName = 'db'; $config->dbUser = 'db'; $config->dbPass = 'db'; $config->dbPort = '3306'; $config->dbCharset = 'utf8mb4'; $config->dbEngine = 'InnoDB'; $config->userAuthSalt = 'xxx'; $config->tableSalt = 'xxx'; $config->chmodDir = '0755'; // permission for directories created by ProcessWire $config->chmodFile = '0644'; // permission for files created by ProcessWire $config->timezone = 'UTC'; $config->defaultAdminTheme = 'AdminThemeUikit'; $config->installed = 1662291609; $config->httpHosts = array('dev-save-issue.ddev.site'); $config->debug = true;
  17. And exactly that was my suggestion: Ask Ryan not to make something hard-coded or opinionated like a toggle to either strip all <!--# comments --> or to leave all <!--# comments --> as is, but ask him to make that definable by the user, so that he/she can for example tell markupregions to leave all comments that start with " ko " as is, so that knockout comments stay untouched and all other comments still get removed. That way you would not have to rewrite your codebase and you can use markupregions with any external tool that relies on a custom comments format.
  18. I'm also having troubles with my RockMatrix module that worked great until the last commit and now stopped saving any content. I'm investigating...
  19. My suggestion was a suggestion for that feature request, not a workaround ?
  20. I totally agree ? Another suggestion could be to add a textarea to define custom comment tags that should not get removed, or maybe a regex or such, eg <!-- ko (having a space after ko)
  21. Thx for the links ? I remember I've also started with both and they were a great help! I just realised that it seems we have no list of all available hooks online somewhere? I'm always looking that up in my IDE (or tracy), but for newcomers such a list (as captain hook) is for sure interesting.
×
×
  • Create New...