Jump to content

Matzn

Members
  • Posts

    55
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Germany

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Matzn's Achievements

Full Member

Full Member (4/6)

12

Reputation

  1. @Liam88 Check your header settings, maybe is set to deny https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options Do you really want to use iframe? It's obsolete.
  2. Hallo @Peter Knight Yes, it was referring to the /processwire/ manager login. I'm a bit surprised, because I thought it was already fixed.
  3. I found some "special" on ProcessLogin.js #login_start is setting by php on server and ts is build by javascript on client. If the time on the server is much older than the time on the client, for example more 300 seconds, you get endless reloading. var startTime = parseInt($('#login_start').val()); // GMT/UTC var maxSeconds = 300; // max age for login form before refreshing it (300=5min) // force refresh of login form if 5 minutes go by without activity var watchTime = function() { var ts = Math.floor(new Date().getTime() / 1000); var elapsedSeconds = ts - startTime; if(elapsedSeconds > maxSeconds) { window.location.href = './?r=' + ts; } };
  4. Hi all, i´ve installed a clear pw 3.0.210, but i can´t login to panelpage. A js function redirect to a endless loop. I don´t found the cause. Since i have several working pw installations (older versions) on the same server, i think i only need some settings. [url deleted] But what is wrong?
  5. Now it makes sense. I thought "ModuleConfigInputfields" are classes constant. That now I understood, thanks.
  6. Thank you for your description. You're right if some syntax isn't 100% correct. But what I mean is the thing is that I can't call a parent function from a child function because the parent field value doesn't inherit. $m2 = $modules->get("TestModuleChild"); print_r($m2->getField());//function will not overwrite in child class The function result is (note field 2) [field 1] => parent module property 1 [field 2] => default field 2 I would have expected (note field 2), because i have input it on parent module (screenshot Parent Module) [field 1] => parent module property 1 [field 2] => Parent Module field 2 So I'm wondering if I can extend processwire class like a php class at all. At least not as a module extension.
  7. @Zeka @ryan I tested again and found that the "ModuleConfigInputfields" are not inherited. This means that the parent methods not can be call from child class, if "ModuleConfigInputfields" are used in parent class. To get "ModuleConfigInputfields" for inherited modul/class must get first the module like: wire()->modules->get('modulname); Here's the proof: <?php //template file namespace ProcessWire; $m1= $modules->get("TestModule"); print_r($m1->getField()); $m2 = $modules->get("TestModuleChild"); print_r($m2->getField()); //output Array ( [field 1] => parent module property 1 [field 2] => Parent Module field 2 ) Array ( [field 1] => parent module property 1 [field 2] => default field 2 ) TestModule.module TestModuleChild.module
  8. @ryan No, i m using other class names. My IDE helps me for wrong syntax. It was not possible for me to get the properties api_user and api_key in a child class. No matter which variant I tried (intern or extern modul config im testing). The values were not available in the children's class. Why, i don't know, maybe i do some ?
  9. Maybe I also have mistakes in thinking and a processwire class can't extend like php. Is that so? I get the parent methodes and properties like: class Child extends Parent implements Module { public function myMethode() { $myParentModul = wire('modules')->get('Parent'); $token = $myParentModul->test(); } }
  10. @Zeka @ryan Hui, now i am confused... Yes, I want a parent/child class relationship like php class extend. I'm writing modules as on this page discribed: ProcessWire 2.5.5 – New module configuration The modul file(excerpt) //file: parent.modul class Parent extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Network Adcell', 'version' => 1, 'summary' => 'Loading Data from Affiliate Network.', 'singular' => true, 'autoload' => false, ); } public function getToken() { $data = $this->_request( 'user', 'getToken', [ 'userName' => $this->api_user, 'password' => $this->api_key, ] ); return $data->data->token; } public function test() { $data = [ 'userName' => $this->api_user, 'password' => $this->api_key, ]; return $data; } } The parent modul config file: //file: ParentConfig.php class ParentConfig extends ModuleConfig { public function getInputfields() { $inputfields = parent::getInputfields(); $f = $this->modules->get('InputfieldText'); $f->attr('name', 'api_user'); $f->label = 'API User'; $f->required = true; $inputfields->add($f); $f = $this->modules->get('InputfieldText'); $f->attr('name', 'api_key'); $f->label = 'API Key'; $f->notes = 'Der API Key muss im Adcell Backend erstellt werden.'; $f->required = true; $inputfields->add($f); return $inputfields; } } The parent modul is an old modul that i can't/wan't thouch. So i think i extend the parent class with new methods. The child modul (excerpt) class Child extends Parent implements Module { public static function getModuleInfo() { return array( 'title' => 'Import Adcell programs', 'version' => 1, 'summary' => 'Import new joined programs and offers.', 'singular' => true, 'autoload' => false, 'requires' => 'Parent modul' ); } public function addProgram() { /* this will get: * array(2) { * ["userName"]=>NULL * ["password"]=>NULL * } */ $token = $this->test(); //some further code } } In child modul if call "$this->test();" get null, because (i think) the ParentConfig will not extend/call what ever. Also is $this->api_user=null and $this->api_key=null. A simple solution is to add a constant/property to parent modul, but i wan't touch this file. I hope we don't talk past each other?
  11. Hey @Zeka, thanks. If i understood, now get the const "1234" from parent class. But wat i need is the admin field from modul (screenshot). Some magic with ParentConfig class must do. But what?
  12. Hi, how I can access parent modules config fields? It is also not possible to use the parent methods include this fields. Example: I need field "api_user" in Child class. class Parent extends WireData implements Module { public function getApiUser() { return $this->api_user; } } class ParentConfig extends ModuleConfig { public function getInputfields() { $inputfields = parent::getInputfields(); $f = $this->modules->get('InputfieldText'); $f->attr('name', 'api_user'); $f->label = 'API User'; $f->required = true; $inputfields->add($f); return $inputfields; } } class Child extends Parent implements Module { //null $apiUser = $this->api_user; //null $apiUser = $this->getApiUser(); }
  13. Oh yes, it´s a old post. But now i have the same issue and find the same results at a multilingual site (post before). What i can do to prevent a redirect? Pass the correct url or i can set some template parameters? Greetings edit This setting causes an endless redirection, if get the url by an other language. But one redirect is still running, eg. for france https//domain.com/ajaxpage => https//domain.com/fr/ajaxpage and there lost the post parameters.
  14. The error message as mentioned above: Now change the affected field to ROW_FORMAT=DYNAMIC like: ALTER TABLE `mytable` ROW_FORMAT=DYNAMIC; In my case for field productDescription: ALTER TABLE `field_productDescription` ROW_FORMAT=DYNAMIC;
  15. Hi @bernhard. I've tested all field settings, but nothing works. I want html to save, because i think i can. ? Edit: But now i found something by save directly this field (i am surprised why get this exception not by saving the page - maybe it´s different by saving from template or module): $this->page->save("productDescription"); I get a SQL error by can't save this table: it was too big or similar message (can't remember on the exact message). This means, the data to save is too big for this table ( field_productDescription). So i've set the table to ROW_FORMAT=DYNAMIC. This is a general problem and know it from other multilanguage sites - but forget. ?
×
×
  • Create New...