Noel Boss

Members
  • Content count

    80
  • Joined

  • Last visited

  • Days Won

    2

Noel Boss last won the day on April 25

Noel Boss had the most liked content!

Community Reputation

124 Excellent

1 Follower

About Noel Boss

  • Rank
    Full Member

Profile Information

  • Gender
    Male
  • Location
    Zurich
  • Interests
    I have a passion for Jesus and the Church and love great development tools – first of all Processwire.

Recent Profile Visitors

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

  1. Noel Boss

    Yep, just saw the comments and version missed that from memory… How about setting up a workflow: If @ryan adds new features etc. he'd notify a mailing-list and whoever has time could add the stuff to cheatsheet? How could we breath life into it again? Because I think it's already great, it would just need some more love
  2. Noel Boss

    Hello everybody. Last night (no sleep) I was thinking about the state of the PW documentation and Cheatsheet in general. How about we relaunch this project, make it open and PW based? There seems to be so much knowledge and doc buried in Blog Posts and added in newer Versions of PW but Cheatsheet and Docs don't seem to reflect these… So i thought about building a new version with the following: New Cheatsheet based on PW Open for contribution by community, the PW community is so great, I think we could keep it uptodate with community effort… Indicate what Version a feature was added Comments on features etc. Links to Blog Articles, PW Weekly & useful Forum entries Example Implementations Hooks and Hook Recipes Maybe open API? What are your thoughts? Any ideas about how to implement stuff? Am I the only one who regularly finds himself tracking down blog-posts, poking for infos in the forum, comments inside files etc? I'd be happy to kickstart and support the project…
  3. Noel Boss

    Hi Kixe Great module, thanks! Saved my site this weekend I have two suggestions as I reviewed my settings. I noticed someting that would probably be easy to implement and at least for me usefull: – No maximum limit of backups (max): why would that option be limited to 100? If I want to store 6hours backups for 3 months, 100 is not enough. - More flexible remove option (deadline): Provide an integer 1-99 plus a intervall: Hours, days, weeks, months years. This way, one can tailor backups and removal very flexible. The current limitations seem very arbitrary for me. On last thought: If it is possible, it would be nice if one can specify a time at which the backup would start – I know, this would just be an indication but still, one could plan the backups for say during night.
  4. I have multiple files on said page and inside repeaters, so this does not work…
  5. Very nice solution – i had the same issue with user profile pictures … this could work… On one of my pages I have a similar setup, I provide protected files using the page and the filename and then manually serving it using the render hook… Would need to look into the code… Something like > pathtothepage/?f=filename.jpg – because you know the page, you can access the file with PageFilesManager ($page->filesManager) and then send it using http://processwire.com/api/ref/wire-http/send-file/
  6. Noel Boss

    Thank you Kogondo! BTW, this is one of the most useful Modules out there! Thank you for developing it!
  7. Noel Boss

    Hi @kongondo No, this works just fine. But this is "pasted PHP code" – since you introduced the option to specify files on the dev Version, it would be nice to use this option also in the frontend; Current status: Dev Version: – include files using module: Backend √ + Frontend X – Past Code: Backend √ + Frontend √ Master Version: – Include files using module: Backend X + Frontend X – Past Code: Backend √ + Frontend √ Desired status Master Version: – include files using module: Backend √ + Frontend √ – Past Code: Backend √ + Frontend √
  8. Noel Boss

    I use this hook to inject edit icons into the breadcrumb. Unfortunately the options exposed by $this->wire('breadcrumbs') are not great, no page id's etc… so it's kind of a hack… public function init() { wire()->addHookAfter('AdminThemeUikit::renderBreadcrumbs', $this, 'renderBreadcrumbs'); } /** * Render a list of breadcrumbs (list items), excluding the containing <ul>. * * @return string */ public function renderBreadcrumbs(HookEvent $event) { if (!$event->return) { return; } $process = $this->wire('page')->process; if ($process == 'ProcessPageList') { return ''; } $breadcrumbs = $this->wire('breadcrumbs'); $out = ''; // don't show breadcrumbs if only one of them (subjective) if (count($breadcrumbs) < 2 && $process != 'ProcessPageEdit') { return ''; } if (strpos($this->layout, 'sidenav') === false) { $out = '<li>'.$event->object->renderQuickTreeLink().'</li>'; } foreach ($breadcrumbs as $breadcrumb) { $title = $breadcrumb->get('titleMarkup'); if (!$title) { $title = $this->wire('sanitizer')->entities1($this->_($breadcrumb->title)); } $edit = ''; $icon = $event->object->renderIcon('pencil'); if (strpos($breadcrumb->url, 'open=') > 0) { $pageid = explode('open=', $breadcrumb->url); $pageid = end($pageid); if (wire('pages')->get($pageid)->editable()) { $edit = "&nbsp;&nbsp;<a href='../edit/?id=$pageid'>$icon</a>"; } } elseif (strpos($breadcrumb->url, '../') !== false && wire('process')) { $pageid = wire('process')->getPage()->parent->id; if (wire('pages')->get($pageid)->editable()) { $edit = "&nbsp;&nbsp;<a href='../edit/?id=$pageid'>$icon</a>"; } // modify open $breadcrumb->url = "../?open=$pageid"; } $out .= "<li><a href='$breadcrumb->url'>$title</a>$edit</li>"; } if ($out) { $out = "<ul class='uk-breadcrumb'>$out</ul>"; } $event->return = $out; } @ryan maybe this would be a useful addition to AdminThemeUikit?
  9. Noel Boss

    True, it's a great module. But does it work for you in the frontend with files? Because as @kongondo said here:
  10. Noel Boss

    This is the description for the dev version. Did not work for me. Ended up with the master and: namespace Processwire; return wireRenderFile('fields/'.$field->name, ['page' => $page]);
  11. Noel Boss

    Would be nice if it is consistent – I use this Field for both, backend and frontend and would love to have the code inside php files.
  12. Noel Boss

    Hi @ryan Thanks alot for the great plugin. I've implemented it and customised it well until this point Now I'm stuck trying to add a user-image to the registration form. The first error is triggered by LoginRegister.module line 438: $form->processInput($this->wire('input')->post); The problem is, that when it's submited, the user does not exist yet, so there is no upload-path at FieldtypeFile.module > hookProcessInput > line 634 Fatal error: Uncaught Error: Call to a member function path() on null in /home/ubuntu/workspace/www/wire/modules/Fieldtype/FieldtypeFile.module:634 Stack trace: #0 /home/ubuntu/workspace/www/wire/core/WireHooks.php(822): ProcessWire\FieldtypeFile->hookProcessInput(Object(ProcessWire\HookEvent)) #1 /home/ubuntu/workspace/www/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\InputfieldImage), 'processInput', Array) #2 /home/ubuntu/workspace/www/wire/core/InputfieldWrapper.php(809): ProcessWire\Wire->__call('processInput', Array) #3 /home/ubuntu/workspace/www/wire/modules/Inputfield/InputfieldForm.module(146): ProcessWire\InputfieldWrapper->___processInput(Object(ProcessWire\WireInputData)) #4 /home/ubuntu/workspace/www/wire/core/Wire.php(383): ProcessWire\InputfieldForm->___processInput(Object(ProcessWire\WireInputData)) #5 /home/ubuntu/workspace/www/wire/core/WireHooks.php(723): ProcessWire\Wire->_callMethod('___processInput', Array) #6 /home/ubuntu/workspace/www/wire/core/Wire.php(442): ProcessWi in /home/ubuntu/workspace/www/wire/modules/Fieldtype/FieldtypeFile.module on line 634 Error: Uncaught Error: Call to a member function path() on null in /home/ubuntu/workspace/www/wire/modules/Fieldtype/FieldtypeFile.module:634 Stack trace: #0 /home/ubuntu/workspace/www/wire/core/WireHooks.php(822): ProcessWire\FieldtypeFile->hookProcessInput(Object(ProcessWire\HookEvent)) #1 /home/ubuntu/workspace/www/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\InputfieldImage), 'processInput', Array) #2 /home/ubuntu/workspace/www/wire/core/InputfieldWrapper.php(809): ProcessWire\Wire->__call('processInput', Array) #3 /home/ubuntu/workspace/www/wire/modules/Inputfield/InputfieldForm.module(146): ProcessWire\InputfieldWrapper->___processInput(Object(ProcessWire\WireInputData)) #4 /home/ubuntu/workspace/www/wire/core/Wire.php(383): ProcessWire\InputfieldForm->___processInput(Object(ProcessWire\WireInputData)) #5 /home/ubuntu/workspace/www/wire/core/WireHooks.php(723): ProcessWire\Wire->_callMethod('___processInput', Array) #6 /home/ubuntu/workspace/www/wire/core/Wire.php(442): ProcessWi (line 634 of /home/ubuntu/workspace/www/wire/modules/Fieldtype/FieldtypeFile.module) This error message was shown because: site is in debug mode. ($config->debug = true; => /site/config.php). Error has been logged. Administrator has been notified. $page as well as $pagefiles does not exist: /** * Hook into the InputfieldFile's processInput method to set the upload destination path. * * This hook originates with the setupHooks method above. * * @param HookEvent $event */ public function hookProcessInput($event) { /** @var InputfieldFile $inputfield */ $inputfield = $event->object; /** @var Page $page */ $page = $event->options['page']; // < Page does not exist > NullPage /** @var Field $field */ $field = $event->options['field']; $pagefiles = $page->get($field->name); // so also field does also not exist… // there should be a check if $pagefiles exists, because: $inputfield->destinationPath = $pagefiles->path(); // …therefore $pagefiles is NULL and ->path(); throws an error. } I tried to provide a path using a hook: wire()->addHookBefore('InputfieldImage::processInput', $this, 'hookProcessInput', ['priority' => 4]); /** * Hook into the InputfieldFile's processInput method to set the upload destination path. * * This hook originates with the setupHooks method above. * * @param HookEvent $event */ public function hookProcessInput($event) { /** @var InputfieldFile $inputfield */ $inputfield = $event->object; $inputfield->destinationPath = wire('page')->filesManager->getTempPath(); } But this throws another error: Error: Exception: Invalid image (in /home/ubuntu/workspace/www/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module line 425) #0 /home/ubuntu/workspace/www/wire/core/Wire.php(383): ProcessWire\InputfieldFile->___processInputAddFile('leo.png') #1 /home/ubuntu/workspace/www/wire/core/WireHooks.php(723): ProcessWire\Wire->_callMethod('___processInput...', Array) #2 /home/ubuntu/workspace/www/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\InputfieldImage), 'processInputAdd...', Array) #3 /home/ubuntu/workspace/www/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module(602): ProcessWire\Wire->__call('processInputAdd...', Array) #4 /home/ubuntu/workspace/www/wire/modules/Inputfield/InputfieldImage/InputfieldImage.module(1304): ProcessWire\InputfieldFile->___processInput(Object(ProcessWire\WireInputData)) #5 /home/ubuntu/workspace/www/wire/core/Wire.php(383): ProcessWire\InputfieldImage->___processInput(Object(ProcessWire\WireInputData)) #6 /home/ubuntu/workspace/www/wire/core/Wi This error message was shown because: site is in debug mode. ($config->debug = true; => /site/config.php). Error has been logged. Administrator has been notified. What do you suggest? Do you see a path to success in adding profile pictures to the module? I could make it work with an existing users profile by way of hooks…
  13. Noel Boss

    I have just released an updated version without autoload. I also added a few helpfull closures to the readme, as well as hook-able methods: https://github.com/noelboss/PageQueryBoss#helpfull-closures--tipps
  14. Noel Boss

    Thank you for the detailed response @kongondo ! The above code does not work, the plugin extends $page so you can directly call ‚pageQueryJson‘ on a Page or a PageArray you call it - altough you need to specify what results you‘d like to receive; $json = $pages->find('template=skyscraper')->pageQueryJson(['title']); from what you describe, it probably does not need to autoload I’ll change that with the next release. Thanks again!
  15. Noel Boss

    Thank you @kongondo No, no reason – I'm new to PW and Module development and had issues with Modules without autoload before – and the module I was taking clues from had autoload true as well. I probably have to look into it a bit more. Any good resources about that? Should I not use it?