Jump to content

gornycreative

Members
  • Posts

    372
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by gornycreative

  1. Frames reminded me a lot of Pinegrow - https://pinegrow.com/ - which has some pretty handy shortcuts in the WP version for breaking out flat HTML designs into loop and block files. Once Yootheme Pro started incorporating real-time previews of custom fields and post/page types it finally started catching up to the flexibility and convenience of certain types of PW builds. I am still finding it faster to work in PW, even though I have had a lot more experience with WP.
  2. Never mind. The simplest way to do this is include $rm->watch methods in ready.php that cover the subset I want to pay more immediate attention to and then run migrate those watched files there: $rm = $this->wire->modules->get('RockMigrations'); $rm->watch($wire->config->paths->site.'/migrations',2); $rm->watch($wire->config->paths->site.'/migrations/matrixtypes',1); bd($rm->getChangedFiles()); // Just to check on things. $rm->migrateWatchFiles();
  3. Say I define in my migrate.php: $rm = $this->wire->modules->get('RockMigrations'); $rm->watch($this->wire->config->paths->site.'migrations',3); $rm->watch($this->wire->config->paths->site.'migrations/matrixtypes',1); Suppose I make a change/save/touch this file as /site/migrations/matrixtypes/meta_zone_1.php: <?php namespace ProcessWire; $rm = $this->wire->modules->get('RockMigrations'); $rm->setMatrixItems('meta_zone_1', [ 'profile_image_block' => [ 'label' => 'Author > Profile Image Block', 'head' => '{matrix_type}', 'sort' => 1, 'fields' => [ 'profile_image_block_layout' => [ 'columnWidth' => 50, ], 'profile_image_block_bio' => [ 'columnWidth' => 50, ], ], ], ]); I've brought in the RepeaterMatrix functions from v1 and added the filetype test to createField - let's assume that. Manually triggered these work. When I run $rm->getChangedFiles() I can see the saved file in the list. A change was detected. If I run $rm->migrateWatchFiles(); the file is rendered and the repeatermatrix item is added. I need to run that method, however, in say Tracy console for the changed files to be seen and migrated. However, when I make changes to watched modules and pageclasses that use MagicPage the migration methods automatically run the next time I load an admin page after saving my changes. How do I get that behavior with watched php files that aren't magicpages or in a module? I can see that ready() in the module contains migrateWatchFiles() - I'm guessing it should be firing? If I add bd($this->getChangedFiles()); ahead of this, it always returns an empty array even though when I run the same method in Tracy it detects changes as I save different files.
  4. I don't know why, but I'm not able to get watched files to trigger. They appear in the watchlist when I run a dump. There are rockmigrations methods in the files. I've set the files to force = true in the watch method in migrate.php. I'm at my wits end. migrate.php triggers on change. Page classes trigger on change. I can't get a single watchfile to trigger. Is there a format to watchfiles that I am missing? Edit: The reason I am running into this now is because I had been keeping field migrate definitions and matrixtype definition methods all on one file but that is starting to get hefty and so I wanted to break out the matrix definition types for various repeatermatrix fields into separate files that would only trigger when a new type was added.
  5. I tried moving the error checking portion that tests for admin and processes form input to the ready() and left the hook definitions in init() and it seemed to work fine as written.
  6. If I do a bd in Tracy: /** * Initialize the module * */ public function init() { $input = $this->wire()->input; // $isAdmin = $this->wire()->page->template->name === 'admin'; bd($this->wire()->page); //Should be the same bd($this->wire->page); //But Just in case I get this: Not even a NullPage object which would at least be something. I found a similar method in a thread from years ago where the limitations of init() were also mentioned. I can't recall if that's the first place I'd seen - it - perhaps in the core code itself? From wire/config.php - I think this is where I first saw hints that anything done in init() doesn't know what page exists. But this doesn't say explicitly that you couldn't *get* the page while in the init context, just that the API var isn't instantiated yet. I'm wondering if bumping it to the ready() state would be an option? The thread I linked never really came to a satisfying conclusion - but I'd also like to know if there is a definitive best practice for how to do this. @horst @Robin S ?
  7. Hey there, I'm trying to track down some PHP warnings, and one comes from this module. I understand you are trying to do some error checking in the configuration in the init() function, but unless I'm totally off on this there is no page context for the init() function in modules. I get two warnings on line 68 because template is run on null and name is run on null.. $this->wire->page in the init() method is null because as far as I understand when the init() method is run there is no page actually loaded yet. As a result $isAdmin is never true and that entire module config test block never loads? The hooks are outside the block - so no problems there, but I'm guessing that clearing variations from the module config doesn't work.
  8. What is the best way to get an array of the default settings for a given fieldtype, and are these defined at the core module layer or a class layer or somewhere else? This seems to be where I should go but I've had problems figuring out exactly how to call it abstractly: https://processwire.com/api/ref/fieldtype/get-config-array/ I'm not talking about the configuration for a fieldtype instance, I mean the config of the class.
  9. When you have a Page Reference inputfield, there are two different template options settings: With the standard migrate() config array, the template_id setting gets processed fine if you use a template name instead of the template_id - the green checkmark. The template_ids setting does not get processed if you use template names. Nothing appears. Adding the processing block I wrote above allows template names to be used in that template_ids setting.
  10. Sorry I'm working in @gebeers RepeaterMatrix fork right now, but if you could add around 3200 in RockMigrations.module.php: (This is below the $key === "template_id" conditional test block.) if ($key === "template_ids") { foreach($val as $sub => $tpl_name) { if (is_string($tpl_name) and $tpl_name !== '') { $tpl = $this->getTemplate($tpl_name); if (!$tpl) throw new WireException("Invalid template_id"); $val[$sub] = $tpl->id; } $data[$key] = $val; continue; // early exit } } This would allow the 'Selectable Pages > Additional Templates' setting on Page Reference fields to migrate the 'template_ids' setting properly with template name references into of raw ids in a similar manner to the template_id setting conversion.
  11. Okay. I'm playing around a little bit with the getCode functions to pull names instead of IDs for certain things and looking at the repeatermatrix situation a little more but I will also look at the tab add situation after.
  12. I'm looking at the code for wrapFields() - is this only for Fieldset and not FieldsetTab? If you are using custom tabs is adding a FieldsetTabOpen field type still recommended and then $rm->addFieldToTemplate('fieldname', 'content-page' , 'tab', 'tab_END'); still the best way to do it?
  13. I have been using $page->sort settings to try to migrate consistent page arrangements and all has gone well except I can't seem to alter the sort arrangement of the error page. I know it is a reserved page. I can alter the sort order between the various reserved pages but I cannot get it to appear higher. The strange thing is that I can set the sort number and if I try to find all pages off of the root page and and sort them by sort: $list = $this->wire->pages->find("parent=1,sort=sort",["include"=>"all"]); and then db($list) the error page does appear properly sorted in the array that results: But in the Pages menu, it remains lower: Are reserved status pages special in this regard?
  14. If you want - I'm not sure if others just haven't ticked the box and gotten the errors, but if its more internal use for you I won't bother with it. Thanks.
  15. Regarding the "include version in admin footer from package.json if it exists" feature - I'm a little confused about what this is for. The code points to the package.json in the site root, not the module root. https://github.com/baumrock/RockMigrations/blob/d957caeb5e4607d0b0afbb00ef18cdcb52895d83/RockMigrations.module.php#L923 But I don't think Ryan stores the processwire version there - which version number is this supposed to show? RockMigrations? My site root package.json looks like: { "dependencies": { "htmx.org": "^1.8.6", "jquery-typeahead": "^2.11.1" } } I started looking into this because I was getting a stdClass::$version warning.
  16. Thank you for addressing this so quickly!
  17. Changing line 40 in TextformatterTypographer.module.php from: public function getModuleInfo() { return json_decode(file_get_contents(__DIR__ . '/TextformatterTypographer.info.json'), true); } to: public static function getModuleInfo() { return json_decode(file_get_contents(__DIR__ . '/TextformatterTypographer.info.json'), true); } resolved the installation issue.
  18. Hi @Mike Rockett I just tried installing this on a dev version of pw 3.0.220 and it seems the new module overhaul might have picked up strange behavior: I mentioned this in a thread of Ryan's also as I'm not sure where the incompatability lies. I also noted that php-typographer has advanced to v6.7.0 which includes some php 8.1 deprecation resolutions.
  19. Had an unusual experience trying to get TextformatterTypographer to install. Looks like it is just essentially a wrapper around a composer library install but for some reason the InstallModule process choked on it with v 3.0.220 If this is a plugin problem I can address it there. The plugin needed to declare the getModuleInfo() function as a static function. Once I added the static attribute the installation went as normal. public static function getModuleInfo() { return json_decode(file_get_contents(__DIR__ . '/TextformatterTypographer.info.json'), true); } I've added the fix request in the plugin thread. I'll leave this here in case there are other older modules that have similar issues.
  20. Yes that's the feature. If you have a large music collection it could take some time to process all of it, and the sonic adventure features do not work until the scanning process is not active - but once you have turned it on it adds material as you go. For around 1200 albums it took my media machine about 4 days to process. I haven't used the ChatGPT connected feature Sonic Sage, but i've heard some folks like it. Track Radio is also a great understated feature. I don't use spotify and I haven't tried connecting Youtube Music. I do know Tidal is not supported - I think it needs to access your files because it doesn't phone home - it literally uses whatever audio files are on your plex server, meaning really obscure stuff you have will get included in the analysis and mixes that may not be available through normal channels.
  21. Also, if you are interested in great international mixes and DJs, this channel has some great guests with intriguing taste:
  22. I have to say that in general, having PlexPass and using their sonic analysis has been the biggest boon to my background programming music setup - the sonic adventure and automated DJ features are phenomenal. When all that matters is consistency of tone and mood, the sonic analysis that the Plex server does on my collection makes it so I don't even have to think about what I want to listen to next - the mood just flows regardless of who it picks. The cool thing is it often pulls a bunch of b-sides or obscure artists songs that I never would think of linking together in a playlist, but the songs mesh like magic.
  23. This seems to through namespace related errors in the latest dev version (3.0.219) Perhaps something related to the modules rework?
  24. Yes, the input value with or without alpha is important in different contexts, but when I am trying to read the value from the fieldtype I can't directly pass the value to the wikimedia LESS parser as it isn't caught up to the JS version and so if I send a raw 32bit integer to get included in the admin.less process it throws and error as an unacceptable format. The strPos( $color, 3) solution works fine - I add a # and the LESS parser is happy. I didn't know if any of the output formatting methods from the fieldtype were exposed on the admin side. Not a big deal either way. For my purposes I've got it working.
×
×
  • Create New...