• Content count

  • Joined

  • Last visited

Community Reputation

73 Excellent

About Karl_T

  • Rank
    Sr. Member

Contact Methods

  • Website URL

Profile Information

  • Gender

Recent Profile Visitors

1,153 profile views
  1. https://php-download.com/ You may use this to get rid of composer, but I don't know how legit it is.
  2. Windows 10 and php-7.1.6-Win32-V14-x64 I didn't try Windows to Windows yet. EDIT: I just create a package and install it with no error.
  3. 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.
  4. 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?
  5. 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.
  6. 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?
  7. Totally support and bump to "Latest Topics". EDIT: Sad it does not work . It would be great if this topic could be more visible.
  8. 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.
  9. 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.
  10. 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.
  11. 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
  12. 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.
  13. 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.
  14. 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.
  15. 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';