valan

Members
  • Content count

    269
  • Joined

  • Last visited

Community Reputation

65 Excellent

About valan

  • Rank
    Distinguished Member
  • Birthday 12/13/1973

Profile Information

  • Gender
    Male
  • Location
    Russia, Moscow

Recent Profile Visitors

5,404 profile views
  1. Module

    Hi @adrian - sure. Check inbox.
  2. Module

    Module has been installed successfully, but any module setting change/save results in "Error: Unrecognized path" with redirect to https://.../admin/module/bookmarks/ What's wrong? PW 2.8.35, PHP 7
  3. I'm developing few custom module classes derived from WireData and WireArray. They are neither Fieldtype (as do not work with db) nor Inputfield (as not used in rendering). Later they may be used in Fieldtypes and Inputfields. Is there "PW way" to name such type of modules?
  4. This issue appeared after upgrade from 2.7.2 to 2.8.35 There are two hooks: - One triggers on ProcessPageEdit::buildFormContent where I add custom fields, e.g. like $form->insertBefore($virtualfield, $realfield);. - Another triggers on saveReady where I get and process values entered in these 'virtual' fields (e.g. $page->virtualfield). Before upgrade it worked. After upgrade, my custom 'virtual' fields are always empty in saveReady hook. Please advice what could be a reason and how to fix it.
  5. That was legacy... Changed code to to static, error disappeared. Getting now another error in ProDrafts module. It says "Class 'ProDrafts' not found in /var/www/pw/mechanics/modules/ProDrafts/ProcessProDrafts.module:28". It's here: public static function getModuleInfo() { return array( 'title' => 'ProDrafts', 'version' => 2, 'summary' => 'List, manage and compare draft pages.', 'icon' => ProDrafts::defaultIcon, // error here Edit: issue is fixed by reinstalling the module.
  6. I'm upgrading from 2.7.2 to 2.8.35 As usual I've replaced /wire and index.php, but this time upgrade failed. During bootstrap system generates "Call to a member function get() on null" on this code in my custom module class ProcessCustom extends Process { public static function getModuleInfo() { $permission = wire('permissions')->get(self::someId); // error occures here ... I have few thoughts: - either wire('permissions') is not supported in 2.8.35 - or error caused by index.php which significantly changed. In 2.7.2 I've used index.config.php (multi-domain config) and now I'm not sure that bootstrap uses it... Please advice where could be a source of the problem.
  7. Yes, Blank and 0 have different meaning. I guess Blank for float = Null. Anyway, hiding field if it's value is null is not expected behavior I think.
  8. There is FieldtypeFleat field "my_float_field" with setting "Blank and Null have different meanings". I have few (strange) issues with it. (1) Issue number 1 When I want to store null in this field, it doesn't save (or return) null. I want to get null back when I save null and 0 when I save integer 0. What's wrong here? $value = null; echo 'Type=' . gettype($value) . ' Value=' . print_r($value, true)); $page->setAndSave('my_float_field', $value); echo 'Type=' . gettype($page->my_float_field) . ' Value=' . print_r($page->my_float_field, true)); echo 'Type=' . gettype($page->my_float_field) . ' Value=' . print_r($page->getUnformatted('my_float_field'), true)); // Result: Type=NULL Value = Type=double Value = 0 Type=double Value = 0 (2) Issue number 2 This field has Visibility=Open+Closed when blank+Locked If I save null in this field, it disappearas from page edit admin. If there is some value - it shows it normally... If I change setting "Blank and Null have different meanings" to "... equivalent" it also does not help. This looks like either bug or some db issue. I've checked field settings in db and didn't find any strange things there... so tend to think that it is bug. Or I don't understand smth... Please help.
  9. I guess this question has been already addressed in some thread(s), but I fail to find complete answer, so posting it here. I know 3 options of accessing API variables from Wire-derived class (see below). Can someone give an in-depth/developer level answer on their relative performance difference and possible limitations (cases when one of these versions might not work as expected - may be PW3 multi-instance related or may be some hook-related issues, etc). 1. $this->pages 2. $this->wire('pages') 3. wire(pages)
  10. Today I've experienced interface issue - input fields were hidden (address, etc). After some inspection, I found that reason was in css - map has changed its relative position. I guess Google has changed smth in script that draws map as there were no changes in css locally. Do you have the same issue? To fix the issue I had to add custom style clear tag to InputfieldMapMarker.module line 161 "style='height: {$height}px;clear:left;' " .
  11. Hmm... strange to see 0 responses here... is it a right forum thread for such questions?
  12. I'm developing single-page application (SPA) which interacts with PW site only with help of ajax post/get calls to custom site API. Initially guest (non-loggeding) user opens page with SPA. Then he logins via ajax call to custom API (requests key, supplying email and pass) and as soon as key is available, makes other ajax calls to custom API with this key. e.g. update own email, phone, etc. Instead of developing custom authorization system, I'd like to use PW built-in authorization. So, my questions are: 1. How to generate key which PW uses to set cookie that is uses to identify session/logged-in user. I guess in my custom API login handler I should create new user session and return some token/key? E.g. how to do that using PW API? 2. Assumed SPA got this key and makes next ajax request to API with this key included in query - how to authorize request / identify user with help of PW API? In sum - I need some guidance on PW API authorization methods that may help me to enable user authorization and access control in custom API from SPA ajax calls.
  13. 1. Is PW 3.x compatible with PHP 7? 2. Would you recommend PW 3.0.18+ in production? E.g. is it too "dev" or already "prd"?) 3. Any known PW-related issues with migration from myisam to innodb? 4. Pros/cons of switching to nginx + mysql + php-fpm? (apart of lack of support, e.g. need to maintain config manually with each upgrade) P.S. Currently site is running on PW 2.7.2, MySQL 5.6.29, db by default myisam, PHP5.5, Apache 2.2.22, OS Debian 7
  14. Module

    @LostKobrakai - see issue here: https://processwire.com/talk/topic/13164-http-error-500-when-opening-some-template-pages/ Described issue happens when script reaches allowed memory limits. I guess it is because ChosenSelect fails to handle too much pages (20000 pages in m case). Anyway, when I've changed inputfield to PageAutocomplete - issue dissapeared.