• Content count

  • Joined

  • Last visited

Community Reputation

80 Excellent

About Karl_T

  • Rank
    Sr. Member

Contact Methods

  • Website URL

Profile Information

  • Gender

Recent Profile Visitors

1,293 profile views
  1. Karl_T

    Thank @dadish for this great module. I liked this post long time ago. I just have a chance to get my hand dirty on it. It turns Processwire to a powerful headless CMS with no pain! I am going to use this in my next project with Vue.js or Nuxt.js. One noob question. Could this module query and mutate session data? I have modules that read/write user, including the unsigned guests, session data. I have no idea how to make it happen using only a GraphQL end point.
  2. Karl_T

    Hi @adrian, I have found an issue regarding page reference field. If the template does not contain title field and the page reference field is listed at the top, i.e. first template field, the module would fail to add/replace the correct value and show empty for that page reference field, while other position is working fine.
  3. Karl_T

    I remember that $this->halt() appears somewhere in the forum too. Just check. This works as well. Thank you!
  4. Karl_T

    Thanks @gebeer! It works with your method. I am using markup region by the way. I thought this variable was some kind of core API.
  5. All solutions I found were using $useMain. It seems that Processwire is no longer supporting $useMain. How can I achieve the same as $useMain did? That is disabling the append and prepend _init.php and _main.php by API. I tried using die or exit(), but that would make TracyDebugger fail to work(not showing ajax information).
  6. I have encountered an issue for Duplicator ver 1.2.9. I am moving a site from localhost(windows 10) to Amazon Linux. I use RDS, which is a standalone server for database, so the dbHost is not localhost. The issue happened in the installation process after entering the database data and proceed. There's an error telling config file cannot be found. Then I go to config.php, there are at least 4 places are using old information. They are dbHost, dbName, dbUser, dbPass and httpHosts. I think for some reasons the config.php did not update at all after the installation complete. After I manually update the fields, the site works fine now. This means database import is working fine. I wonder if it is the dbHost matters. It is a long URL ended with xxx.rds.amazonaws.com.
  7. Karl_T

    I did some trials and find that the original crop(cropper js) is able to do the job. Most codes sit inside a core module called ProcessPageEditImageSelect. Zoom can be enabled by setting zoomable to true in ProcessPageEditImageSelect.js, but it only allows zoom-in (scale >=1). For making some extra white space for the image, I need the zoom-out function. Then, I update cropper.js to the latest version(from v.0.7.8 to v4.0.0). It works after I fix some broken codes("done" method is not working). Then I stuck when I try to crop images. If I zoom-out, I get error message like this: Missing or wrong param x=-84 for ImageSizer-cropExtra! Array ( [0] => -84 [1] => -58 [2] => 620 [3] => 380 ), while zoom-in works just fine. I check the ImageSizer.php and ImageSizerEngine.php. I found that negative x value is throwing the exception. This explains why I cannot zoom-out. https://fengyuanchen.github.io/cropper/ In case you are interested, this demo can demonstrate the negative X value when zoom-out(scroll down the mousewheel). I think the negative value should be filled by white space by php. I have no idea how to implement this into ImageSizer.php and ImageSizerEngine.php yet. Welcome any ideas. Thanks!
  8. https://php-download.com/ You may use this to get rid of composer, but I don't know how legit it is.
  9. 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.
  10. 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.
  11. 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?
  12. Karl_T

    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.
  13. Karl_T

    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?
  14. Karl_T

    Totally support and bump to "Latest Topics". EDIT: Sad it does not work . It would be great if this topic could be more visible.
  15. Karl_T

    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.