valan

Members
  • Content count

    281
  • Joined

  • Last visited

Community Reputation

70 Excellent

About valan

  • Rank
    Distinguished Member
  • Birthday 12/13/1973

Profile Information

  • Gender
    Male
  • Location
    Russia, Moscow

Recent Profile Visitors

5,522 profile views
  1. @ryan may be you can help? Thanks.
  2. @Robin S @LostKobrakai thanks. This method looks like a right method for input-specific js/css. It creates config under $this->attr('id') on initial page load... but now w/o values. Looks like when Ajax visibility is set, PW knows $this->attr('id') but doesn't know $this->my_config_key and $this->attr('value'). How to get these values in this method when Ajax visibility is set? P.S. If visibility set to "Open", everything works OK, e.g. it does not work with 2 Ajax visibility options. public function renderReady(Inputfield $parent = null, $renderValueMode = false) { $this->config->js($this->attr('id'), [ 'config' => [ 'my_config_key' => $this->my_config_key, // = null (it's an inputfield config parameter) 'pageId' => $this->attr('value'), // = 0 (it's a page id from InputfieldPage) ], ]); parent::renderReady($parent, $renderValueMode); }
  3. @Robin S thanks for check. Looks like problem is deeper. May be at MySQL level as we've migrated to InnoDb. Or smth else. And thanks for sensible advice!
  4. @arjen thanks. I guess that such kind of errors like "endless loops somewhere in the core" require line-by-line execution debugger in order to find where it occurs. Not sure that Tracy may help here, but will give it a try. I also think its a core issue, not site-specific. Could you check it in admin? - move any page under any user (preliminary make sure you've enabled 'may have children' in user template). Page will be moved, but spinner will continue to run, blocking any further work in admin, so you'll need to create a new session (restart browser/login again).
  5. @kixe thanks. $page already exists, so no need to set template again. Anyway, I did it but issue remained - the same $page->save(). I'm not really advanced enough programmer to debug PW core code (and don't have proper debugging tools, wire('log')->error('My error'); was always enough for me))
  6. Code below works everywhere else, except if applied to pages in Admin tree. Specifically, I change parent to some 'user-car' pages and place them under some 'user' page in admin tree. $page->of(false); $page->parent = $some_user_page; $page->save(); $page->save() freezes, e.g. method does not not return any value/looks like in falls in endless loop somewhere inside. It also does not generate any errors. As it happens only in Admin tree (everywhere else it works), root cause could be: (1) in template settings (I've checked and didn't found any "restrictions", e.g. 'user-car' pages can be freely moved, 'user' may have children) or (2) in core code, somewhere in Page::save() Please, advise how to fix this issue.
  7. Well, specifically, I'm interested to know how to pass js to the page on ajax call. Currently ajax-driven inputfields work only for fields that do not set js inside render(). But what to do if I have such code in render()? $this->wire('config')->js($this->attr('id'), [ 'config' => $my_array, ]); Moving it to init() does not work, as $this->attr('id') is not set at that moment. Adding js script (with <script>my_js_code_that_sets_config();</script>) to redner() output also does not work - script tags are removed by PW. P.S. Just in case if it matters - I'm developing inputfield for FieldtypePage, e.g. it is added to InputfieldPage inputfieldClasses setting.
  8. @Zeka hi! This file has only declaration of constants. There should be better sources to learn
  9. I'd like to create custom ajax-driven inputfield. Ajax-driven inpufields where introduced here: http://processwire.com/blog/posts/new-ajax-driven-inputs-conditional-hooks-template-family-settings-and-more/#new-ajax-driven-inputfields-system-wide, but since that time I haven't seen any "how-to" tutorials. I'd like to learn from core code, but can't understand which files to check. Can someone suggest which core/module files I have to check in order to learn from code and be able to create custom ajax-driven inputfields?
  10. Module

    Hi @adrian - sure. Check inbox.
  11. 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
  12. 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?
  13. 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.
  14. 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.
  15. 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.