Jump to content

thei

Members
  • Posts

    15
  • Joined

  • Last visited

Everything posted by thei

  1. imported production database, installed RM 6.5 and copied RockMigrations folder with fields and repeater fields files. So this is the first effect: PDO Error 1050
  2. above i wrote "Even when i removed the Config Migrations files for these repeater fields these repeater fields have "doubles" in the template fields" i.e. i couldn't reproduce this effect (new repeater-field rows when repeater-field Config-Migrations file is moved away. But: a repeater field Config - Migrations file produces to an improper database when refreshing modules is clicked
  3. at the moment i cannot reproduce the effect, when moving away 'contact.php' and the problem does not disappear.... Cache? i deleted the cache
  4. <?php /* repeater field contact */ return [ 'accordionMode' => 0, 'allowContexts' => [ 0 => 'repeaterTitle', ], 'collapsed' => 0, 'columnWidth' => 100, 'familyFriendly' => 0, 'fields' => [ 'desc' => [ 'rows' => 1, ], 'role' => [ 'columnWidth' => 25, ], 'email' => [ 'columnWidth' => 25, ], 'phone' => [ 'columnWidth' => 25,], 'mobile' => ['columnWidth' => 25, ], ], 'flags' => 0, 'icon' => 'user-md', 'label' => 'Contact', 'lazyParents' => '', 'loudControls' => 0, 'parent_id' => 0, 'rememberOpen' => 0, 'repeaterAddLabel' => '', 'repeaterCollapse' => 3, 'repeaterDepth' => '', 'repeaterLoading' => 1, 'repeaterMaxItems' => '', 'repeaterMinItems' => '', 'repeaterTitle' => '', 'required' => '', 'requiredIf' => '', 'showIf' => '', 'tags' => 'address organisation', 'template_id' => 0, 'themeBorder' => '', 'themeColor' => '', 'themeOffset' => '', 'type' => 'FieldtypeRepeater', ]; <?php /* field 'desc' */ return [ 'collapsed' => 0, 'columnWidth' => 100, 'contentType' => 0, 'flags' => 0, 'htmlOptions' => '', 'icon' => 'sticky-note-o', 'inputfieldClass' => 'InputfieldTextarea', 'label' => 'Description', 'maxlength' => 0,'minlength' => 0, 'placeholder' => '', 'required' => '', 'requiredAttr' => '', 'requiredIf' => '', 'rows' => 5, 'showCount' => 0, 'showIf' => '', 'stripTags' => '', 'tags' => 'text', 'textformatters' => [ 0 => 'TextformatterEntities', ], 'themeBlank' => '', 'themeBorder' => '', 'themeColor' => '', 'themeInputSize' => '', 'themeOffset' => '', 'type' => 'FieldtypeTextarea', ]; <?php /* field 'role' */ return [ 'collapsed' => 0, 'columnWidth' => 100, 'flags' => 0, 'icon' => 'black-tie','inputfieldClass' => '','label' => 'Role', 'maxlength' => 2048, 'minlength' => 0, 'pattern' => '', 'placeholder' => '', 'required' => '', 'requiredAttr' => '', 'requiredIf' => '', 'showCount' => 0, 'showIf' => '', 'size' => 0, 'stripTags' => '', 'tags' => 'organisation', 'textformatters' => [ 0 => 'TextformatterEntities', ], 'themeBlank' => '', 'themeBorder' => '', 'themeColor' => '', 'themeInputSize' => '', 'themeInputWidth' => '','themeOffset' => '', 'type' => 'FieldtypeText', ]; <?php /* email */ return [ 'collapsed' => 0, 'columnWidth' => 100, 'flags' => 9, 'icon' => 'at', 'inputfieldClass' => '', 'label' => 'E-Mail Address', 'maxlength' => 255, 'minlength' => 0, 'pattern' => '', 'placeholder' => '', 'required' => '', 'requiredAttr' => '', 'requiredIf' => '', 'showCount' => 0, 'showIf' => '', 'size' => 0, 'stripTags' => 1, 'tags' => 'communication', 'textformatters' => [ 0 => 'TextformatterEntities', ], 'themeBlank' => '', 'themeBorder' => '', 'themeColor' => '', 'themeInputSize' => '', 'themeInputWidth' => '', 'themeOffset' => '', 'type' => 'FieldtypeText', ]; ~ <?php /* phone */ return [ 'collapsed' => 0, 'columnWidth' => 100, 'flags' => 0, 'icon' => 'phone', 'inputfieldClass' => '', 'label' => 'Phone', 'maxlength' => 2048, 'minlength' => 0, 'pattern' => '', 'placeholder' => '', 'required' => '', 'requiredAttr' => '', 'requiredIf' => '', 'showCount' => 0, 'showIf' => '', 'size' => 0, 'stripTags' => '', 'tags' => 'communication', 'textformatters' => [ 0 => 'TextformatterEntities', ], 'themeBlank' => '', 'themeBorder' => '', 'themeColor' => '', 'themeInputSize' => '', 'themeInputWidth' => '', 'themeOffset' => '', 'type' => 'FieldtypeText', ]; <?php /* mobile */ return [ 'collapsed' => 0, 'columnWidth' => 100, 'flags' => 0, 'icon' => 'mobile', 'inputfieldClass' => '', 'label' => 'Mobile', 'maxlength' => 2048, 'minlength' => 0, 'pattern' => '', 'placeholder' => '', 'required' => '', 'requiredAttr' => '', 'requiredIf' => '', 'showCount' => 0, 'showIf' => '', 'size' => 0, 'stripTags' => '', 'tags' => 'communication', 'textformatters' => [ 0 => 'TextformatterEntities', ], 'themeBlank' => '', 'themeBorder' => '', 'themeColor' => '', 'themeInputSize' => '', 'themeInputWidth' => '', 'themeOffset' => '', 'type' => 'FieldtypeText', ]; ~ when i put the files shown above in RockMigrations/fields and click module refresh... | 51 | repeater_contact | {"noChildren":1,"noParents":1,"slashUrls":1,"pageClass":"RepeaterPage","noGlobal":1,"compile":3,"modified":1736510539,"_lazy":1,"_rockmigrations_log":"--- 2025-01-10 13:02:19 ---\n"} | | 77 | repeater_contact7 | {"noChildren":1,"noParents":1,"slashUrls":1,"pageClass":"RepeaterPage","noGlobal":1,"compile":3,"modified":1736933902,"_lazy":1,"_rockmigrations_log":"--- 2025-01-15 10:38:22 ---\n"} | | 79 | repeater_contact8 | {"noChildren":1,"noParents":1,"slashUrls":1,"noGlobal":1,"compile":3,"modified":1736933910,"_rockmigrations_log":"--- 2025-01-15 10:38:30 ---\n"} | | 80 | repeater_contact9 | {"noChildren":1,"noParents":1,"slashUrls":1,"pageClass":"RepeaterPage","noGlobal":1,"compile":3,"modified":1736933916} |
  5. Thanx for your quick reaction. Hm, "steps" i installed 6.5.0 (previously a had an old version (5.2..?) installed) i copied the code from the RockMigrations code field to set up the files using fieldname as filename in RockMigrations/fields. e.g. 'label.php' below <?php return [ 'collapsed' => 0, 'columnWidth' => 100, 'flags' => 0, 'icon' => 'bookmark-o', 'inputfieldClass' => '', 'label' => 'Label', 'maxlength' => 2048, 'minlength' => 0, 'pattern' => '', 'placeholder' => '', 'required' => '', 'requiredAttr' => '', 'requiredIf' => '', 'showCount' => 0, 'showIf' => '', 'size' => 0, 'stripTags' => '', 'tags' => 'text', 'textformatters' => [ 0 => 'TextformatterEntities', ], 'themeBlank' => '', 'themeBorder' => '', 'themeColor' => '', 'themeInputSize' => '', 'themeInputWidth' => '', 'themeOffset' => '', 'type' => 'FieldtypeText', ]; i remember i did some changes via GUI and did not update the appropriate field file. At the moment i have no idea how/where to start with debugging RockMigrations
  6. i started to use Config Migrations in an existing processwire application. In directory site/RockMigrations/fields i created all the files defining the fields. Up to now i created only two templates (i.e. 2 of 15 but this shouldn't matter) in the appropriate templates folder - so far. yesterday my database crashed after clicking the admin modules page - a PDO Error 1062 / duplicates... so i did some research in the database. i found the templates table contains something like duplicated repeater field rows - the field 'contact' has some duplicates with same name followed by numbers 'contact8' 'contact9' etc. I could repair the database by deleting these strange rows. When i click on module refresh, some new repeater field rows will be created. The crash seems to be a rare case. Such rows can exist and the application still works in some way but some content of repeater fields is missing on pages. The problem occurs with repeater fields only. Even when i removed the Config Migrations files for these repeater fields these repeater fields have "doubles" in the template fields. When i switch of RockMigrations this behavior disappears. RockMigrations 6.5.0 / PW 3.0.227
  7. Hi, i'am new with FrontendForms. I use v2.2.16. When i set custom classes it is ignored. When i define a framework as described i can select it in the settings and save the config. But nothing happens. The class names i see in the generated html are always the same generic names e.g. fieldwrapper etc. So, i can write by my own a class "fieldwrapper" and it works - sure. But this is - as far as i understood the documentation - not the intention of framework files: to be without effect. Where do i get it wrong? Or is there a bug? Thank you for your help
  8. Ah! i see. It's the keyword 'options'. In my example i used 'text'. I just tested it and it works using when 'createField()' - great! Thank you!!
  9. i'm using Rockmigrations the first time. I copied field settings (Rockmigration Code) from an Processwire site in the migration.php of a new Processwire environment. It works fine except for one options field: it throws Fatal error: Uncaught Error: Class "ProcessWire\SelectableOptionManager" not found in /var/www/html/app/site/modules/RockMigrations/RockMigrations.module.php on line 4144 here is the code $rm->createField('country', 'text', [ 'collapsed' => 0, 'columnWidth' => 100, 'defaultValue' => '', 'flags' => 0, 'icon' => 'flag-o', 'initValue' => '', 'inputfieldClass' => 'InputfieldSelect', 'label' => 'Country', 'options' => [ 65 => 'Germany', 120 => 'Namibia', 1 => 'Afghanistan', 2 => 'Albania', 3 => 'Algeria', 4 => 'Andorra', 5 => 'Angola', 6 => 'Antigua and Barbuda', 7 => 'Argentina', 8 => 'Armenia', 9 => 'Australia', 10 => 'Austria', ...etc... ], 'required' => '', 'requiredIf' => '', 'showIf' => '', 'tags' => 'address', 'themeBorder' => '', 'themeColor' => '', 'themeInputSize' => '', 'themeInputWidth' => '', 'themeOffset' => '', 'type' => 'FieldtypeOptions', ]); I do not understand what the problem is with the options field Thanx for ideas and help 🐵
  10. Hi BitPoet, YES indeed it works. Thank you very much!! Nevertheless this case should be handled inside PW rather than checking for $page in the user defined hook. HM... what is the further procedure here. Should i report a bug? Where? Otherwise: the guideline here in this forum says, i should mark this as 'soved' by clicking the 'mark-as-solved' button. BUT there is no 'solved-button' displayed here ?
  11. what is the procedure now? should i write a bug report? i guess here https://github.com/processwire/processwire-issues/issues ? Thank you for your help ?
  12. hm. if i download the latest stable i get a 3.0.227 (cannot find a 228) with 3.0.227 still the same behavior. OK found 229. same problem.
  13. but for a repeater field the page object is of class RepeaterPage. Using ->template returns 'repeater_....' which is not the name of the embedding page. The documentation of RepeaterPage describes a getForPage
  14. i 'm writing a hook for repeater labels $this->addHookAfter('InputfieldRepeater::renderRepeaterLabel', function(HookEvent $event) { // Get the object the event occurred on, if needed $InputfieldRepeater = $event->object; // An 'after' hook can retrieve and/or modify the return value $return = $event->return; // Get values of arguments sent to hook (if needed) $label = $event->arguments(0); $cnt = $event->arguments(1); $page = $event->arguments(2); // Your code here, perhaps modifying the return value // just a simple test: $return = "LABEL " . $page->getForPage()->template(); // Populate back return value, if you have modified it $event->return = $return; }); this hook function works (e.g. if i return a constant string) as long as i don't use '->getForPage()' the error message is '...... Page::getForPage does not exist or is not callable in this context' The hook is in 'ready.php'. it seems the events setting especially "$page" property is not complete within context? i want to set the repeater labels only if the parent of pages has a special template. (i m using Version 3.0.210) What i am doing wrong? Who can help? Thank You
×
×
  • Create New...