Jump to content

Karl_T

Members
  • Posts

    158
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Karl_T

  1. I found that the real cause is the php method realpath() used inside Duplicator.module. Reference: http://php.net/manual/en/function.realpath.php#example-2719 The method is generating the backslashes in Windows, which makes the zip extraction look like this. Here is my fix. $source = realpath($source); //search this line $source = str_replace('\\', '/', $source); //add this line $file = realpath($pathname); //search this line $file = str_replace('\\', '/', $file); //add this line The installer runs nicely now.
  2. I get the same result and the installation cannot proceed further. The package was built in localhost using Laragon. The destinated server is Ubuntu 17.10. I did the transfer from the same Ubuntu server to localhost for the same site before. EDIT: I test the same package in the Windows Laragon localhost. It works nicely. The issue is happened in step 3. Does the backslashes that generated by Windows matter? Maybe DIRECTORY_SEPARATOR should or should not be used?
  3. It really depends. User like me use prefix on field name would benefit from keeping the search term. The reason why I prefix fields is to distinguish what inputfield the field are using. For page reference field for product I name it page_product, so I can quickly spot the field when I search "product" or "page". I also believe many developers here like you do not use prefix a lot too. It seems like no perfect solution here unless everyone name and use fields in the same way. The best way might be that the keeping search term and scroll position could be toggle on/off. Anyway, they are relatively minor, the search function is already a great efficiency boost for me and also saves me from future client's complaints.
  4. Great thanks for this. Efficiency boost a lot! I have tried a bit to solve the jump and search value removal after selecting. I have changed aos.js(around line 1411) to below. It seems working good for single instance. var selectScrollTop,searchText; // this selecting save the scroll position and search value $(document).on('select2:selecting', '.asmSelect', function (event) { selectScrollTop = $(".select2-results__options").scrollTop(); searchText = $(".select2-search__field").val(); }); $(document).on('select2:select', '.asmSelect', function (event) { var $asmSelect = $(this), src = event.target || event.srcElement; if (src.tagName === 'SELECT') { // var inputSelector = '.select2-search__field', // searchTermAttr = 'data-select2-search-term', // searchTerm = $(inputSelector).val(); // save search term in parent's data attr // $asmSelect.parent().attr(searchTermAttr, searchTerm); // change and rebuild + reopen $asmSelect.val(null).trigger('change.select2'); $asmSelect.select2('destroy'); if ($asmSelect.parent().find('[data-asm-placeholder]').length) { select2Config.placeholder = $asmSelect.parent().find('[data-asm-placeholder]').attr('data-asm-placeholder'); } $asmSelect.select2(select2Config); $asmSelect.select2('open'); // the below 2 lines are added to restore the scroll position and search result $(".select2-search__field").val(searchText).trigger('keyup').trigger('input'); $(".select2-results__options").scrollTop(selectScrollTop); // restore previous search term // $(inputSelector).val($asmSelect.parent().attr(searchTermAttr)); // $(inputSelector).trigger('keyup').select(); } }); Edit: I overlooked. You have already made the search term restoration but you have commented them. Any considerations for this?
  5. Totally support and bump to "Latest Topics". EDIT: Sad it does not work . It would be great if this topic could be more visible.
  6. Thanks for implementing this function. Your ideas are nice! One thing to mention is that if option closeOnSelect: false is used, an unwanted jump to the first item would happen every time when an option is chosen. Related issue post: https://github.com/select2/select2/issues/4417 Maybe we could use a forked version to handle the issue if it matters.
  7. Here is a trial that works for asmSelect, but in an ugly way as autoload modules load Javascript before the asm inputfield. Hope this could help. Select2.module class Select2 extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Select2', 'version' => 0, 'autoload' => true, ); } public function init(){ $data = $this->data; $this->config->scripts->add('https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js'); $this->config->scripts->add($this->config->urls->Select2 . 'main.js'); $this->config->styles->add('https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css'); } } main.js $(function(){ var loop = setInterval(function(){ var $select = $(".asmSelect"); if($select.length > 0){ $(".asmSelect").select2({ closeOnSelect: false }); clearInterval(loop); } }, 200); }); PS: Using selectize.js is not working with the above code.
  8. Yes the one in template editing, and all other select fields such as page reference field. Those lists could grow really long. This library most likely would not work with asmSelect as it alters the options inside the select tag, so as the selectize.js. select2.js preserves the original select tag, which is more likely to work with least effort.
  9. Hi @tpr, I would like to have a little feature request here. I guess most of us feel pain when choosing fields and templates in dropdown select if the list grows large. I think we could implement a search function to make us more efficient. I think AOS is the best place to implement this. After some brief search, select2.js could be a good candidate. It hides the original select tag instead of using some div with hidden input field, so it , most likely, does not affect the inputfield like asm select. With option closeOnSelect: false could prevent the open and close behavior every time when we choose an item from asm. Also, it looks easy to implement. I hope you could consider adding this. https://select2.org/getting-started/basic-usage
  10. My client has requested a custom image field, with a predefined width and height for the output image. The field works like this: after the image upload, or when re-editing the image, the uploaded image can be drag around, resize and rotate within the set canvas. The background color can be chosen, so the output image could have extra padding to make it look nicer. (I know this should be done using paint or photoshop, but my client thinks that this is cool and a must have function) I wonder if Processwire can do the job, or a module with similar function had been developed before (googled with no luck). Although I think this could be done with a custom module using HTML5 canvas with a related javascript library (I have some experience) to replace the original cropper (override executeEdit in ProcessPageEditImageSelect.module), the image field looks complex to me to extend. Extra data has to be stored too, like canvas object data to retain the existing objects' position. Any thoughts are welcome. Thanks.
  11. After reading a bit the source code, I found that the module edit form can be altered by hooking to ProcessModule::executeEdit and append the hidden admin page fields to the output form. For saving the module, we can hook to Modules::saveModuleConfigData to save the hidden page fields there. But for the below reason, I would stick to process module instead. I may try this approach next time. I get your point. I can give process module a permission, but individual module edit page cannot (is it correct?). This is a real benefit of using process modules. Modules like SEO module should be able to let digital marketing team to edit while have them away from other module configs. I would use the native inputfields as I want the module to be multilingual. I am not sure should I output the ProcessPageEdit or use something else.
  12. I am developing a SEO module with the latest industry standard. I want to upload some images such as logos and used by the module as default setting, while everything is configurable inside the module config page. I know the fact that module configuration page is not allowed to have file/image upload field due to the module fields are only inputfields but no fieldtypes. I would like to adopt an approach to solve this issue. The approach is that, in module installation, I create a page somewhere inside admin with file/image field. And then inside the module config page, the needed fields can be referenced and rendered for image upload. Any similar modules has used similar approach? This approach can also be used for complex fields like repeater field for hreflang, open graph and twitter card too. I don't know if the above setup is possible. Please feel free to share any thoughts or advise another approach.
  13. Is it safe to directly change the database engine from MyISAM to InnoDB through some database GUI softwares like Mysql workbench or phpmyadmin? I have one site installed wrongly with MyISAM engine(Live site, shame...). I want to turn all tables to InnoDB, especially the fields for transaction. from wire\config.php /** * Database engine * * May be 'InnoDB' or 'MyISAM'. Avoid changing this after install. * */ $config->dbEngine = 'MyISAM';
  14. Thanks for your solution @Macrura. I found that the reason why dynamic function is not working. This is because the class of the select field are amended by the repeater so the jquery is not able to select the DOM correctly. What we should do is to fix it by targeting the correct DOM by changing the selector. I can get it to work with already saved repeater page but not the newly added one. I think a listener is needed to attach the on change event to newly added repeater item when we press Add New. EDIT: The newly added repeater item surprisingly fires the js again. It is working fine now. A small bug is that the old repeater items will fire more than once if there are more than one newly added item. Below is the amended JS file for InputfieldPage in quick EDIT: The bug is fixed. I have submited a pull request. Hope we could see this feature in the core soon!
  15. Is it possible to apply to fields within repeater? It is working great without using repeater, but it is not when the fields are inside a repeater item even after saving the page.
  16. Hi @elabx, thanks for your input. The best Fieldtype candidate should be PageTable. However, there is an issue if the PageTable is used directly as Fieldtype. The end product may look just like Repeater Matrix, which, I think, is not a good idea. So, I would suggest that the function of adding different template("type" in Repeater Matrix) should be removed. Inputfield could be just like Repeater. Adding a new set of css, configurable in field setting, maybe good enough to reduce the bloated feel as someone may concern. The above are some brief ideas if I would develop the modules.
  17. Sorry that's my bad I didn't specify clearly. The main function I want from the Page Table is the ability of editing/adding children, while it also has the ability to edit/add pages somewhere else just like repeater but more flexible(choose any parent).
  18. Thanks for the feedback. Repeater is really robust in terms of editing content. It presents all fields in a native way, with the nesting and sorter and configurable layout. I have used batch child editor in the past. I mostly use it to import large amount of data. It lacks the ability to show and edit the fields at once (you may get this ability if you have ListerPro, but I failed to enable the inline editor in my last trial).
  19. I would like to see a field that acts just like Page Table field but with Repeater UI. Right now the downside of using repeater is that they are not normal pages. There are limitations when referencing them. Their page name is not editable too. Also, They are off from the URL structure. I start to avoid using repeater if possible after I face these downside in my last project. However, the Page Table field UI is not quite user friendly.
  20. Thanks for your suggestion! It is weird that I didn't follow my own post. I am having an error when a new page is generated in admin(new > enter title and name > save > error). It is an error related to database which is my weakness(thanks to Processwire I do not have to deal with it on my own). Could anyone help taking a look? github Session: Error saving field "price" - SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
  21. Sorting is a build-in function of template. You may edit it in admin by editing any parent template like "home". edit parent template>Family tab>Sort settings for children>choose "name" under "Children are sorted by">check for reverse or not
  22. I used simple var_dump to debug a bit as I don't know why tracy debug is not working(Please tell me if you have any idea ). I found that the issue is positioned at ProcessCroppableImage3.module line 234 and 235. isset($this->input->post->quality) and isset($this->input->post->sharpening) are returning false. Thus, the value is returned as options['quality'] instead of user input intval($this->input->post->quality). // when I choose 60 quality var_dump($this->input->post->quality, isset($this->input->post->quality), is_numeric($this->input->post->quality), 0<intval($this->input->post->quality), 101>intval($this->input->post->quality)); // return : string(2) "60" bool(false) bool(true) bool(true) bool(true)
  23. Sorry, it is the Process module that in version 1.1.10, while the Wrapper module 1.1.15. The version I installed is up to date already.
  24. The module is installed by module installer using module name. The module version is 1.1.10. PW version 3.0.83. Step1: Change the seting and hit "Crop And Go". Step2: Jump to the confirmation. The quality and sharpening remain unchanged. (Should be changed to 75 and none as above here) Step3: Repeat above steps with default setting(soft, 90). Step4: Check the image cropped by changed setting and default setting. They have the same file size.
×
×
  • Create New...