Jump to content

owzim

PW-Moderators
  • Posts

    490
  • Joined

  • Last visited

  • Days Won

    4

owzim last won the day on March 12 2015

owzim had the most liked content!

About owzim

  • Birthday 09/09/1983

Contact Methods

  • Website URL
    http://owz.im
  • Skype
    chrauni

Profile Information

  • Gender
    Not Telling
  • Location
    Berlin, Germany
  • Interests
    Design, Frontend, Music, Cycling, Nutrition, Politics, Evolution

Recent Profile Visitors

12,868 profile views

owzim's Achievements

Sr. Member

Sr. Member (5/6)

607

Reputation

4

Community Answers

  1. This is how I've done it, hooks to the rescue. Clean. $this->addHookProperty('Language::code', function(HookEvent $event) { $lang = $event->object; $event->return = $lang->name === 'default' ? 'en' : $lang->name; }); So now you can access it as a property of languages. $user->language->code;
  2. Hi, unfortunately I currently have little resources for that. You are welcome to open a PR though.
  3. The rendering ($page->render()) is taken care of elsewhere.
  4. That is also an option I thought about, but this is for a module I am creating and I don't want users of that module to jump through those hoops.
  5. I want to render pages without the need of a template file. 404s still work.
  6. Thanks, ProcessPageView::pageNotFound is definitely the right spot, I came up with this method, don't know if it has any access rights implications: public function hook_ProcessPageView_pageNotFound(HookEvent $event) { $page = $event->arguments('page'); $page->template->filename = 'path/to/existing/file'; if ($page->viewable()) { $event->return = $page->render(); $event->replace = true; } } Page render actually outputs something, because I hook into it. But just not with a template file.
  7. Thanks, unfortunately this gives my only ''access not allowed" as a $reason, so if I would overwrite the behavior via hook, based on that, I would mess with all kinds of access management.
  8. Hi, is there a way to change that behavior? Can I hook into that somehow? Thanks!
  9. Hi, I ran into this issue a while back and remember fixing it but haven't pushed to master. I will have to look into it. I think it might work on the dev branch, not sure though. Edit: yup it's fixed on the dev branch. I use it on a production site, but I appreciate any quick testing in your environments, so that I can merge it into master, if no further issues arise. Thanks for reporting!
  10. Works now, thanks a lot @Mike Rockett for reacting so fast.
  11. Thanks for the update @Mike Rockett. After the update: without trailing delimiters (foo;bar) I get: ProcessJumplinks: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '-0001-11-30 00:00:00' for column 'date_start' at row 1 With trailing delimiters (foo;bar;;) I get: Notice: Undefined index: date_end ProcessJumplinks: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '-0001-11-30 00:00:00' for column 'date_start' at row 1 This only happens if I input more than one line. If it's only one line, it works. If it's only one line, both values separated by the delimiter land in the source field, destination stays empty. Is there a reason, why you rolled your own CSV parser instead of using str_getcsv?
  12. Hi @Mike Rockett, I can't get the CSV import on 1.5.46 to work: Tried: foo,bar baz,qux foo;bar baz;qux foo,bar,, baz,qux,, foo;bar;; baz;qux;; In the cases without trailing delimiters I get: Notice: Undefined index: source Notice: Undefined index: destination ProcessJumplinks: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '-0001-11-30 00:00:00' for column 'date_start' at row 1 With trailing delimiters, the jumplinks are created but source is empty and destination is a string: page:1. I made sure, no empty lines are present.
  13. A classic case of RTFM %#~* Thanks @Mike Rockett, this is brilliant.
  14. Thanks @Mike Rockett, the implicit option with {all} will suffice. I haven't dug too deep into all the options, but it would be great if mapping could be done without collections: source: project?id={someCustomField} dest: projects/{someCustomField} So that someCustomField would be a field of projects/ child pages, like $pages->get('/projects/')->children('someCustomField={value}'); This way one could simply migrate the ids of the old site over. source: project?id={oldID} dest: projects/{oldID} $pages->get('/projects/')->children('oldID={id}');
  15. Hi @Mike Rockett, this module is awesome, thanks! I have this collection thing going on: example source: project?id=1&foo=bar So I set it up like this: source: project?id={id}&foo=bar dest: projects/{id|projects} Works! But, when &foo=bar is omitted this does not work: project?id=1 How to make anything after id optional, I tried brackets, but it does not work. source: project?id={id}[anything here, but optional] Thanks!
×
×
  • Create New...