Jump to content

bernhard

Members
  • Posts

    6,221
  • Joined

  • Last visited

  • Days Won

    308

Everything posted by bernhard

  1. I don't know if that could be the reason, but I don't use the host at all any more in my config files. I always use the concept of including different files on my local development and on remote servers. See here: One of the reasons is that the hostname (or in your case the HTTP_HOST variable) might not be available. For example when bootstrapping or calling it from a cronjob. Or the variable might be empty for whatever reason. When including different config-local.php files on local dev and on production/staging you don't have these problems. That would at least be something that you can try.
  2. Hey @FireWire this issue should be fixed in v5.9.2 ๐Ÿ™‚ Please mark the topic [solved] if it works for you! Thx
  3. Yes I always use underscores. I had problems with hyphens several times. I can't remember any more where exactly, but I remember that avoiding them was the easiest solution. Any sources for that? PW definitely uses camelcase constants like Inputfield::collapsedHidden which I think looks nicer than Inputfield::COLLAPSEDHIDDEN. But I'd be happy to get some links to read.
  4. I'm not sure about this. That should only be the case on regular runtime migrations, but when doing a modules refresh all migrations should fire. I'm using RM Deployments and they perform a backup before each deployment. Is that what you are looking for?
  5. Hey @gebeer thanks for trying out Config Migrations so early ๐Ÿ™‚ ๐Ÿ’ช Same here ๐Ÿ˜ The file should not be in /site/modules/Site/RockMigrations/... but should live side by side with Site.module.php! I just had a look into the docs and you are right - the instructions there are like you say. I have to look into what you said tomorrow, but if you have time and read this in the meantime, then I'd appreciate if you could try to create the file /site/modules/Site/RockMigrationsConstants.php and see if that maybe fixes some other of your mentioned issues? Thx a lot! I'll likely do exactly that ๐Ÿ™‚ As of 2 days ago we have PHP8.4 released and PHP8.1 gets security fixes only - so I think it would even be fine to have PHP8.2 as a requirement for the module. Any other votes?
  6. I think I don't understand your question, because from how I understand you the answer what I'd do is to just create two commits. v1 / commit: initial version v2 / commit: make it better v3 / commit: make it best But I guess that's not what you where asking for? Or are you talking about release tags? Then have a read here: Or you could also create two or three branches. For example I have some modules that I can't update on some servers, but I had to develop them further for new projects. Then on older projects some issues arise, so what to do? You are on an old commit and the current development state of the module is 17 or whatever commits ahead. "git pull" is not an option, so you can create a new branch for the old version (eg "git checkout -b 'foo.com'" - which would create the branch foo.com) and push your updates there. So you'd have a "main" branch with the module for all current projects and you'd have the "foo.com" branch for the stale project "foo.com"
  7. Glad it was helpful @herr rilke! Yeah that would be possible. Another option would be to solve it with nested elements, so you'd have a "color" container that can hold other blocks (like headline, text, image, etc). Even that would already be possible using RockPageBuilder and @Stefanowitsch did something quite crazy in this regard and hopefully shares it one day with us ๐Ÿ˜‰ But I try to not introduce any kind of multi-level editing for clients. I try to keep things as simple as possible and only add necessary features. But coloured sections is one of them imho.
  8. Hey @FireWire I need the raw Sourcecode not the formatted one from the devtools. In chrome use right click show source rather than inspect element.
  9. No, I'm recommending DDEV, but it should not matter as it should work either way.
  10. Hey @Atlasfreeman I'm a little confused. Why did you post this in the RockPageBuilder forum? MagicPages are a feature of RockMigrations. Do you use any of the features of MagicPages? If not, you could just remove the use MagicPage statement (line 11 in HomePage.php). Maybe that's already enough to fix the issue, then do a modules refresh and then maybe try to add it back again if you need or are unsure.
  11. Hey @herr rilke thx for your interest. Unfortunately nobody else showed interest so it looks like a video would not be interesting to a lot. I did that as well, but what I don't like with that approach is that if you move a block you have to adjust all classes of all blocks which is tedious. My approach works similar but different ๐Ÿ˜› I use a dedicated block type solely for the color. This block sets a custom runtime flag (like $site->bgColor) and all blocks then add a custom class based on that bgColor flag's value. So once I have a color block with setting "muted" all following blocks might get the class "bg-muted", for example. Then when the next color block comes up it might set the bgColor flag to "primary" which would tell all following blocks to add the class "bg-primary". Now the challenge is to make that work with spacings and with frontend editing. On frontend editing the problem to solve is with sorting blocks, because classes come from php and sorting is done on the client with JS. So you need to add a little js to adjust classes once sorting happens. In my project this is done like this: // section color updates on sort document.addEventListener("rocksortable-added", (event) => { let sortable = event.detail; sortable.option("onMove", (e) => { setTimeout(() => { let el = e.dragged; let container = el.closest("[sortable]"); let children = container.children; let colorClass = null; // loop all items and update color classes for (let i = 0; i < children.length; i++) { let child = children[i]; // don't change class of dragged item if (child.classList.contains("sortable-drag")) continue; // update colorClass on every rpb-color block if (child.classList.contains("rpb-color")) { colorClass = child.getAttribute("data-col"); continue; } // update colorclass of element if (!colorClass) colorClass = "white"; child.classList.remove("has-bg-white"); child.classList.remove("has-bg-muted"); child.classList.remove("has-bg-primary"); child.classList.remove("has-bg-secondary"); child.classList.add(`has-bg-${colorClass}`); } }, 0); }); }); For block spacings I've switched my approach from PHP based calculations to CSS based calculations. The trick is to only use margin-top for blocks, because then you can define different margins for blocks based on the previous block like this: .bg-white + .bg-muted { margin-top: 20px; } This way you can achieve a lot of flexibility in your design with very little complexity in code. Hope that helps!
  12. Yes that's all you needed to do ๐Ÿ™‚
  13. Hi @nurkka thats a good question ๐Ÿ™‚ I'd love to have some kind of migration feature for RockPageBuilder content, but unfortunately it's not there yet. What is already there is an API for blocks, so it's already quite easy to work with block data from the API (https://www.baumrock.com/en/processwire/modules/rockpagebuilder/docs/api/). What I usually do in such situations is to always create content on the live site. This is the single source of truth for content. When using RockShell all content changes to your live site are just one command away: rockshell db:pull production But if you have lots of content it might be worth to write a simple script that uses the block api. Or maybe others have some creative ideas as well?
  14. I can remember that the first time installing DDEV was also a little hard for me as well. But it only has to be done once and it has definitely payed off! Good luck ๐Ÿ™‚ Oh and if you have troubles reach out to ddev on their git repo. They are extremely fast and helpful!
  15. I think it will, but I don't know. So please either create an issue for ProcessWire to ping ryan about that or just mark this topic solved ๐Ÿ™‚ One day I'll have to rebuild the frontend and backend of RPB to use the same tech and then this issue will also be fixed..
  16. bernhard

    PHP Hosting

    There you have it: For me the experience was terrible ๐Ÿ˜„ But I have been using there services years ago. I can only remember having had troubles when deploying applications because they had some weird permission setups. At least that was weird to me back then. I might judge differently nowadays. But I'm happy with Hetzner (for VPS hosting).
  17. I thought you only "need" mutagen on mac and you don't need it on windows if you are using WSL? I'm on mac + mutagen and I'm happy with that setup ๐Ÿ™‚ I think @dotnetic is on windows + WSL?
  18. So it's something that Ryan would have to add as an option to the frontend editing module?
  19. Hi @Stefanowitsch ALFRED uses PW's frontend editing which uses jQuery for the modals. I'd love to have a better solution, but that's what we have. Can you try to disable loading of jQuery in Alfred.js and see if that maybe fixes your issue and maybe it works with the version that you load on your frontend? Then I could add a setting to not load Alfred in the frontend if the frontend already uses jQuery. Also try to use the same version of jQuery that the backend uses.
  20. I solved this by renaming the field instead of moving content. In this case this was the even better (as more performant) solution, but I'd still be interested if anyone knows another way of doing this!
  21. Have a look at URL hooks! https://processwire.com/blog/posts/pw-3.0.173/ Oh, and welcome to the forum ๐Ÿ˜‰
  22. Hey @FireWire the error does not come from block markup, it comes from the {alfred()} call, as the error message tells. Alfred needs a json to get all block settings and it should look like this in the source code (don't use the devtools here): Also look into the console - it should log the element with the wrong alfred json. Once we know the json we can see how to fix it.
  23. Hi @elvina can you try the latest commit of the dev branch? I have added it to RockFrontend as it's only +270kB
  24. Hi everyone! Today I had to move some data stored in a repeater field to another field. I searched the forum and found an admin action by @adrian and came up with a new method in rockmigrations that can copy or move repeater items to new fields and/or new pages: https://github.com/baumrock/RockMigrations/blob/ad59425831c74e32034035afa9d2276f398cc2be/RockMigrations.module.php#L3536 Now I realised that there is a problem: The way this works is it creates new items and then removes the old items. But that also means that IDs change ๐Ÿ˜ฎ And I have referenced those repeater items from somewhere else. Does anybody have an idea of how to do that?
ร—
ร—
  • Create New...