Jump to content

horst

PW-Moderators
  • Posts

    4,077
  • Joined

  • Last visited

  • Days Won

    87

Everything posted by horst

  1. It is not intended to be set as global / default option sitewide. You definitly need to set it with every request. The default behave is, if you do not explicitly define an outputformat, the outputformat is the same as the inputformat: jpg => jpg jpg => setOutputformat('png') => png So, it is not a bug in the module, but a "bug" in the description here. I will update the description. Thanks for pointing out, @BernhardB.
  2. Just some thoughts: Can you try to renew the Session between deleting and the new creation. (Logout and Login again). What modules are active? Something like page-path-history?
  3. @SteveB: Sorry, I need to update this in the description here. The UI for Imagesizer options is removed now, as it could interfere with the ConfigModule. I think it is better to have only one SettingsPage / UI screen than multiple, what can let to confusion. Pia is meant to assist in Image API handling, and the ConfigModule is meant for UI handling of config options. So, the UI for Image Sizer Options isn't there anymore, for all PW versions, 2.5+ and 3.0+.
  4. @adrian: I have a running PW 3 now, and played a little with Tracy. Really, really useful. Thank's for that, (also to @tpr!) Regarding the configuration and features: Personally, I would like to only have those features visible / enabled, I currently need. phpinfo is definetly not one of them. I think when I use 1000 times the debugger, I would need 2 times the phpinfo. What's about a single and simple ASM in the configscreen, that lets the user enable / disable features? I have done it that way with ALIF, I don't think it is to much confusing or overwhelming. It would need one ASM in the configscreen and one additional line in your render method: https://github.com/horst-n/AdminLinksInFrontend/blob/master/AdminLinksInFrontend.module#L1437 Anyway, with or without configurable features, it's a very useful module, especially for remote debugging (on live servers) !!
  5. It depends on what you want to measure. If you want to start measuring the time when the prepend file is parsed, thats the right solution. If you want measure the time from the beginning of execution, you also can start in the _init.php and end in the _main.php. As I said, it completly depends on what you want do.
  6. @tpr: Yes, you are right, this is already known as possible solution. see: https://processwire.com/talk/topic/12326-redirect-after-login-to-original-page/#entry114235 I think, @adrian is interested in why it is not working with his module, because it should be. ?!
  7. Hah! It's working now with using $include_fuel ? wire('all')->getArray() : array(), Thanks, @Lostkobrakai! You made me happy!
  8. For me, this doesn't change anything. I have added the namespace ProcessWire to all files that belong to Spex and all my template files too. The error persists. Here are the call stack of my debugger. The relevant lines are 11, 10, 9, 8. As you can see, at runtime it is translated / called ProcessWire\ProcessWire->getArray(). Is this right in regard what we should expect here? index.php(62) Exception: Method ProcessWire::getArray does not exist or is not callable in this context (in ...\pw3\wire\core\Wire.php line 347) #0 [internal function]: ProcessWire\Wire->___callUnknown('getArray', Array) #1 ...\pw3\wire\core\Wire.php(303): call_user_func_array(Array, Array) #2 ...\pw3\wire\core\WireHooks.php(555): ProcessWire\Wire->_callMethod('___callUnknown', Array) #3 ...\pw3\wire\core\Wire.php(327): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessWire), 'callUnknown', Array) #4 ...\pw3\wire\core\ProcessWire.php(471): ProcessWire\Wire->__call('callUnknown', Array) #5 ...\pw3\wire\core\Wire.php(328): ProcessWire\ProcessWire->__call('callUnknown', Array) #6 ...\pw3\wire\core\Wire.php(328): ProcessWire\ProcessWire->callUnknown('getArray', Array) #7 ...\pw3\wire\core\ProcessWire.php(474): ProcessWire\Wire->__call('getArray', Array) * #8 ...\pw30\site\modules\Spex\Spex.module(250): ProcessWire\ProcessWire->__call('getArray', Array) * #9 ...\pw30\site\modules\Spex\Spex.module(250): ProcessWire\ProcessWire->getArray() * #10 ...\pw30\site\modules\Spex\Spex.module(155): ProcessWire\Spex->getTemplateVars() * #11 ...\pw3\wire\core\WireHooks.php(626): ProcessWire\Spex->templateFileRenderBefore(Object(ProcessWire\HookEvent)) #12 ...\pw3\wire\core\Wire.php(327): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #13 ...\pw3\wire\modules\PageRender.module(500): ProcessWire\Wire->__call('render', Array) #14 ...\pw3\wire\modules\PageRender.module(500): ProcessWire\TemplateFile->render() #15 [internal function]: ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent)) #16 ...\pw3\wire\core\Wire.php(303): call_user_func_array(Array, Array) #17 ...\pw3\wire\core\WireHooks.php(555): ProcessWire\Wire->_callMethod('___renderPage', Array) #18 ...\pw3\wire\core\Wire.php(327): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageRender), 'renderPage', Array) #19 ...\pw3\wire\core\WireHooks.php(626): ProcessWire\Wire->__call('renderPage', Array) #20 ...\pw3\wire\core\WireHooks.php(626): ProcessWire\PageRender->renderPage(Object(ProcessWire\HookEvent)) #21 ...\pw3\wire\core\Wire.php(327): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Page), 'render', Array) #22 ...\pw3\wire\modules\Process\ProcessPageView.module(205): ProcessWire\Wire->__call('render', Array) #23 ...\pw3\wire\modules\Process\ProcessPageView.module(205): ProcessWire\Page->render() #24 [internal function]: ProcessWire\ProcessPageView->___execute(true) #25 ...\pw3\wire\core\Wire.php(303): call_user_func_array(Array, Array) #26 ...\pw3\wire\core\WireHooks.php(555): ProcessWire\Wire->_callMethod('___execute', Array) #27 ...\pw3\wire\core\Wire.php(327): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageView), 'execute', Array) #28 ...\pw3\index.php(53): ProcessWire\Wire->__call('execute', Array) #29 ...\pw3\index.php(53): ProcessWire\ProcessPageView->execute(true) #30 {main} E_USER_ERROR Spex.module has: <?php namespace ProcessWire; public function getTemplateVars($include_fuel=true) { return array_merge( $include_fuel ? wire()->getArray() : array(), // should be: $include_fuel ? wire('all')->getArray() : array(), !! array('spex' => $this), array('slots' => $this->slots), $this->templateVars ); }
  9. For me it is not working too. I have prefixed all files with namespace ProcessWire, but getting the same error: Method ProcessWire::getArray does not exist or is not callable in this context (in .../wire/core/Wire.php line 347)
  10. Don't know if it will change anything, but it can be worth a try: instead of include_once("./init.inc"); you may try to use include_once( dirname(__FILE__) . "/init.inc");
  11. Sorry, I cannot follow. A queue only stores the data you put into it, nothing more. If you need references to whatever, put it into your data. That's the only way to have your needed data together. But this has nothing to do with the queue. Once again, the queue is nothing else than a storage, a DB table, with exactly 1 field for your data. Therefore, (I think you do this already), you have to wrap your data into an array. If you need more data-information as you currently have in it, just put it into the data array too.
  12. @Vayu_Robins: +1 for adrians module. That's the perfect fit for your needs. How could I not think of it? I use it myself on a site.
  13. Oh! Thanks, Charles. I completly missunderstood. Do you know, where I can find infos about what and / or how those credentials need to be?
  14. Hhm, this may be only of less importance, and I hope, someone else will chime in with a good solution. But if not, I use a login and logout feature with the userswitcher of my ALIF module. If you are comfortable with module creation and hooks, you may have a look at it and pick up some code to build a small module. (Or you put a small code piece into the init.php or ready.php)! The hook method: https://github.com/horst-n/AdminLinksInFrontend/blob/master/AdminLinksInFrontend.module#L284 // if it is in a module, it can look like this: public function hookBeforeProcessLogin(HookEvent $event) { // early return, if it is not a link with the GET param id_original if(!$this->input->get('id_original')) return; // get the redirect URL $id = (int)$this->input->get('id_original'); // sanitize via typecasting $p = wire('pages')->get("id=$id"); if(0 == $p->id) return; // it was not an existing / valid pageid // ?? maybe here you have to do additional validation to secure that the returned page is meant to be served // and that it is not one, the user has no access to, ... ?? ... // if it is a valid page, redirect now $this->session->redirect($p->url); } Not tested, written in the browser, no warranty, but hope it helps.
  15. With the UI, you cannot! Archiveing means what it says. If you want to stop using it, with the possibility to reuse it later, please use pause. I'm not sure on this, as it isn't meant to do this by design, but you may try to cahnge the fieldvalue by API: // get the desired queue page by its id $queue = $pages->get("id=1234"); // get the fieldname that stores the state $fieldname = WireQueue::WIRE_QUEUE_FIELD2; // change value from 4 (archived) to 3 (paused), or 2 (active) $queue->$fieldname = 3; // or 2 $queue->save(); BUT: Without warranty. I'm not sure if this has any sideeffects, its not tested!
  16. Hi Can, a short code example how I would go with it. It is written in the browser, not tested, and it is the bare core of my idea, you need to add the rest by yourself, if it works: // $tags is a string like: "Processwire>Docs>Security" function doTags($tags, $tagParent = 'tags') { $vars = array('sanitizer', 'pages'); foreach ($vars as $var) ${$var} = wire("$var"); $parts = explode('>', $tags); // parts now holds the hirarchical ordered parent list, without the rootParent named in $tagParent $parent = $pages->get("name=$tagParent"); foreach($parts as $part) { // try to get a childpage with name $part and parent = $parent $p = $pages->get("parent=$parent, name=" . $sanitizer->pageName($part)); if(0 == $p->id) { // if it do not exist, create it now $p = new Page(); $p->parent = $parent; $p->template = 'tag'; $p->title = $part; $p->save(); } // switch parent to the next level: $parent = $p; } }
  17. Thanks Charles! Bernhard, I'm not sure, but best thing would be, if you can run this locally and use an IDE with debugger. Everything in this regard is Sessionbased. You need to check / debug those functions in the module: public function hookBeforeProcessLogin(HookEvent $event) { public function hookBeforeProcessLogout(HookEvent $event) { public function hookAfterSessionLogout(HookEvent $event) { public function hookAfterSessionLogin(HookEvent $event) { Also I don't know what you mean with: "after some setup problems"?
  18. checklist that helped me in those situations: are all involved php files saved in utf-8 ? do the involved db_tables save the data in utf-8 ?
  19. Unfortunately not all dependency files (.php, .module) of the croppable images module are detected and compiled by the modules compiler of PW 3. I think this is already told to Ryan, but not sure. If you like, you can add an issue to the Github repo of the devns branch: https://github.com/ryancramerdesign/ProcessWire/blob/devns/wire/core/FileCompiler.php
  20. If I understand right, you need to set the sort order for all children under artists to manual drag-n-drop. This can be done under pages -> artists -> edit -> children -> Sort Settings. Then, in your tempklates / API, you add to your selector sort=sort, // example with manual sort order $children = $pages->find("parent=/artists/, sort=sort, limit=10");
  21. I have tried it out 1 or 2 years back on an apache server in comparision to PHP. The use case was, that I used ProCache there for an archive with 2k+ pages that, once created, never will be changed. But every page has had embedded a section with a register of names as links, what continuosly should grow. I thought and tried if it would be possible to use SSI to include this section into the cached html pages. But for me it worked out that SSI was much slower than PHP on this server.
  22. Hi Arjen, in this case, the InputfieldText extends the Inputfield class and has to provide a class named ___render(). Every class that extends the Inputfield class have to do this, otherwise an error will be thrown by PHP. But the parent class itself has not an executable method. To declare it abstract means, it is declared as mandatory for all (child) classes that extends this (parent) class to have this method.
  23. I'm not sure, but I think it is not possible to hook into an abstract declared method: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/core/Inputfield.php#L577, or is it?
×
×
  • Create New...