Search the Community

Showing results for tags 'exception'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • ProDrafts
  • ListerPro
  • ProFields
  • ProCache
  • Form Builder
  • Likes
  • ProDevTools
  • Custom Development

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 8 results

  1. Dennis Spohr

    Hi all, with $config->adminEmail it's possible to send out an email for fatal errors (for example a syntax-error). It would be nice to get also an email in case of an unhandled exception. There could be a situation of an wrong upload and exceptions on the live-page. Is this possible? Also it could be a very handy feature to be able to choose specific logs which are sent our via email automatically. Thanks for your feedback, Dennis
  2. Hello! I have a strange problem with the "delete" method of the "pages" API-variable: When I insert a parent- and a child-page, and then immediately try to delete first the child- and then the parent-page, an exception is thrown telling me that the parent cannot be deleted, because it still contains a child-page. You can reproduce this behaviour using the following code: <?php require 'index.php'; $parentPage = new ProcessWire\Page; $parentPage->name = 'parent'; $parentPage->template = 'basic-page'; $parentPage->title = 'parent'; $parentPage->parent = $pages->get('/'); $parentPage->save(); $childPage = new ProcessWire\Page; $childPage->name = 'child'; $childPage->template = 'basic-page'; $childPage->title = 'child'; $childPage->parent = $pages->get('/parent'); $childPage->save(); $pages->delete($pages->get('/parent/child')); $pages->delete($pages->get('/parent')); (I put this code into a file called "experiments.php" in the root directory of the site, because I do not know of any better way for quickly testing out code in ProcessWire yet) Can you tell me why this code throws an exception? What am I missing? I am using ProcessWire 3. Thanks for your help! PS: Yes, I know about the second parameter in the "$pages->delete" method, but it should not be necessary to be set in this scenario if I`m correct.
  3. I am trying to install Processwire + an exported custom profile and keep getting this error: Does anyone recognize this? What could cause this? I have installed Processwire + exported profiles many times before, never had problems. I have reuploaded fresh downloads for this, both regular master and dev, but keep getting the same thing. I am probably doing something dumb. Probably not a structural PW issue. I am out of ideas, so any feedback appreciated. Edit: Finally got something to install using the standard blank profile, instead of an exported profile. I am now manually reconstructing my custom site, using the new import/export functions - hit or miss so far. Did those break the ProcessProfileExport module?
  4. While coding some templates I need to throw some Wire404Exceptions, which, expectedly, sets correct headers and renders 404 page. Since all these exceptions are extending Exception class, I can call its constructor with a message like this <?php $demoName = sanitizer()->pageName(input()->urlSegment1); $demo = pages('template=demo, name=$sanitizedPagenameFrom'); if(!$demo->id) { throw new Wire404Exception("Demo named $demoName cannot be found, but check out its source page instead"); } // inside template 404.php // somehow get the error $message echo "<h1>Page does not exist</h1>" echo "<p>$message</p>" What I want to do is to somehow catch this exception, or get inside 404 template the message that I set earlier in some module or another function, so that I can notify the user with a better message than "Error 404: Page not found". There's some parts inside core that handles this sort of things but they're not utilized. <?php // inside /wire/core/ProcessPageView.php public function ___execute($internal = true) { // ... try { // try to render the page } catch(Wire404Exception $e) { return $this->pageNotFound($page, $this->requestURL, false, '404 thrown during render'); } // ... } protected function ___pageNotFound($page, $url, $triggerReady = false, $reason = '') { // reason is not used, or passed to 404 template } So, is there a way to manually catch the exception thrown? For instance, with Silex all exceptions can be intercepted using <?php $app = new Silex\Application(); $app->error(function (\Exception $e, $code) { exit('asd'); });
  5. Hi, I working on auser module and have recently got this error when trying to delete a user: Error: Exception: You do not have permission to execute this module - ProcessPageView this only happens when accessing the user->delete function as the below within my module. Anyone happen to know why that may be? // @string $user = name field public function deleteUser($user){ $u = $this->users->get($user); if($u->id) { $this->users->delete($u); } } similar to this error i believe:
  6. I have a project that uses a variant of the "main.inc" template strategy. All templates are set to use a single "main.php" file. That file uses output buffering to include page-specific views and insert them into a "base" template. Generally, this works great and allows me to structure my files exactly the way I want. However, I've found that if I want to manually throw a Wire404Exception, it just bubbles up uncaught rather than being handled. The 404 handler works fine in instances where I'm not calling it manually, but fails otherwise, specifically when I'm dealing with urlSegments. I'm not that familiar with PHP's exception handling in general nor ProcessWire's exception handling in particular, so I'm not sure how to further troubleshoot. Some abbreviated pseudo-code to illustrate: main.php: ob_start(); include('./views/'.$view.'/'.$view.'.inc'); $layout = ob_get_clean(); ob_start(); include('./views/base/base.inc'); $template = ob_get_clean(); echo $template; With this setup, if I try to throw a Wire404Exception within any "view", the exception isn't handled, so logged in admins see the error trace, and regular users get an ISE. e.g., view.inc: if($input->urlSegment1){ // look for stuff... if(!$match){ throw new Wire404Exception(); } } Any thoughts?
  7. steveooo

    Hello, for a module that's used in the admin, I need the ->size(x, y) functionality for creating thumbnails of existing images. I tried it but I got following exception: ProcessWire: ProcessPageList: Method Pagefile::first does not exist or is not callable in this context I hope someone can help me with that! Thanks!
  8. seddass

    Hello, I have received many emails with same error message and I am wandering how to change the code to get more meaningful errors. Hope someone know what could to be the reason for that exception or how to render more details in that exception. Аny help is greatly appreciated. Below is the error: Unknown User:/?/:ProcessWire Error:Exception: SELECT id, class, flags, data FROM modules ORDER BY class (in /var/www/my-domain/www.my-domain.com/wire/core/Database.php line 72) #0 /var/www/my-domain/www.my-domain.com/wire/core/Modules.php(142): Database->query('SELECT id, clas...') #1 /var/www/my-domain/www.my-domain.com/wire/core/Modules.php(79): Modules->load('/var/www/my-dom...') #2 /var/www/my-domain/www.my-domain.com/wire/core/ProcessWire.php(100): Modules->__construct('/var/www/my-dom...', '/var/www/my-dom...') #3 /var/www/my-domain/www.my-domain.com/wire/core/ProcessWire.php(45): ProcessWire->load(Object(Config)) #4 /var/www/my-domain/www.my-domain.com/index.php(167): ProcessWire->__construct(Object(Config)) #5 {main}