Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Matzn

  1. I had probably missed the notification of this post. Check this: If landing_page_html->url is hosted on a foreign domain, every browser blocks iframe traffic. Remedy: The foreign domain user must add your domain as trusted domain to there server settings. Than will send a header include your domain to iframe and the browser accept traffic. If landing_page_html->url on the same domain, the safety settings of the server could prevent this. One option is as from @applab that WAF is blocked. The server of the foreign domain accept only certain user agents You can alternatively test the HTML-Object Tag.
  2. @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.
  3. Hallo @Peter Knight Yes, it was referring to the /processwire/ manager login. I'm a bit surprised, because I thought it was already fixed.
  4. 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; } };
  5. 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?
  6. Now it makes sense. I thought "ModuleConfigInputfields" are classes constant. That now I understood, thanks.
  7. 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.
  8. @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
  9. @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 ?
  10. 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(); } }
  11. @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?
  12. 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?
  13. 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(); }
  14. 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.
  15. 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;
  16. 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. ?
  17. I've tested alternate syntax with "setLanguageValue" . Get the same result. But to sanitized the input from field "productDescription" works: $this->page->productDescription = $this->sanitizer->textarea($this->productTypeData->description); Are there bad signs that cause this to skip? As I said, only at the last language (danish). If i change the language order, it's always the last language.
  18. I want to save HTML Code in multilanguage field (productDescription -> texarea, unknow text) from module. But for the last language is nothing written in this field. It only works when I sanitized the string. foreach ($this->languages as $language) { $this->user->language = $language; //get spreadshit product data $this->productTypeData = $this->getProduct($language); $this->page->of(false); //fields by language $this->page->title = $this->productTypeData->name; $this->page->fit = $this->productTypeData->sizeFitHint; $this->page->shortDescription = $this->productTypeData->shortDescription; $this->page->productDescription = $this->productTypeData->description; //include html tags $this->page->save(); }
  19. Ok, is no magic. $res->getStart(); etc. PaginatedArray class - ProcessWire API
  20. Hi all, how i can get total, start, limit etc from page object? $res = $pages->find("template=basic, limit=20"); Result from page 2: ProcessWire\PageArray Object ( [count] => 20 [total] => 95 [start] => 20 [limit] => 20 [pager] => 21 bis 40 von 95 [items] => Array ( [Page:0] => Array ( [id] => 17212
  21. @Macrura I have tested something. If add the date field to page or repeater page it works, but not to a fieldsetpage: echo "\nFieldsetPage:\n"; echo $page->Check->ratingDate; echo "\n"; echo $page->Check->getUnformatted("ratingDate"); echo "\nPage:\n"; echo $page->ratingDate; echo "\n"; echo $page->getUnformatted("ratingDate"); echo "\nRepeaterPage:\n"; echo $page->About->businessProvider->first()->ratingDate; echo "\n"; echo $page->About->businessProvider->first()->getUnformatted("ratingDate"); Live Result: FieldsetPage: 19.05.2021 19.05.2021 Page: 19.05.2021 1621375200 RepeaterPage: 19.05.2021 1621429619 It's a bug or i can set somthing?
  22. @wbmnfktr ic know this postes, but no way to get the unix timestamp by $page->getUnformatted('yourDateField'); I also used it in several projects, but now the output must be set for date field to none. So i use this date field only as $page->yourDateField; I also don't understand why one field is save as unix and the other not (same settings).
  23. Hi, i have two date fields. One stores in unix timestamp (ratingDate) the other as a normal date (googlePageSpeedDate). Both have the same settings! How can I influence the saving? The strange thing is that I can't get the unix timestamp by (Check is the FieldsetPage) $page->Check->getUnformatted('googlePageSpeedDate'); ProcessWire\FieldsetPage Object ( [id] => 9932 [name] => for-page-1072 [parent] => /admin_panel_page/repeaters/for-field-389/ [template] => repeater_Check [name1067] => [status1067] => 1 [googlePageSpeedDate] => 2021-05-17 00:00:00 [data] => Array ( [name1067] => [status1067] => 1 [googlePageSpeedDate] => 2021-05-17 00:00:00 ) ) ProcessWire\RepeaterPage Object ( [id] => 1137 [name] => 1618998033-3988-1 [parent] => /admin_panel_page/repeaters/for-field-312/for-page-1075/ [template] => repeater_businessProvider [name1067] => [status1067] => 1 [isSocialMedia] => 0 [businessProviderPage] => (Page) 1132 [rating] => 4,6 [ratingUsers] => 10 [ratingDate] => 1621240175 [urlTo] => https://maps.google.com/?cid=11132489695980159614 [reviewUrl] => [data] => Array ( [name1067] => [status1067] => 1 [isSocialMedia] => 0 [businessProviderPage] => ProcessWire\Page Object
  24. It´s a old post, but i'm looking for this same problems. Hope, helps you, too. It must be noted that if "When output formatting is off the value of an image/files field is always a WireArray" found here to save works only $page->save(image/files field) Example for a custom field "counter" : $page->of(false); $file = $page->csvFiles->first(); $file->counter = "your content here"; $page->save('csvFiles'); Actually easy.
  25. Omg. The issue is caused at php version 8.0.2. Processwire running perfekt to php 7.4. I'm looking for entries in protocolls: nothing. No php error or warnings for this issue. That's mean. @wbmnfktr @BitPoet I thank both of you. Closed
  • Create New...