Jump to content

Raymond Geerts

  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by Raymond Geerts

  1. I was playing around with concat fields, this way you can compair to nested values other then an page id. For example to show/hide certain fields. The only thing is that it is not 'live' but only shows/hides the regarding fields after the page is saved. For example if you have a single-page field type for example with 3 pages with names "one, "two", "three". This field is called "choice". Then a concat field with the name "choice_concat" and "choice.name" in the "Names of fields to concatinate", assigned to the same template would be able to target in a "Show this field only if..." for example the condition is "choice_concat=two". But keep in mind this only shows/hides the fields after the page is saved, and not live at modifying the value that has the dependency. Its more then logic why this is, because the concat field only gets its value when its modified after the page is being saved. Note that the above example is not complete. The setup i was trying it out has a single-page select and those related pages have a single-page select too. The latter one im targeting with the condition. to show/hide certain fields. So actualy the concat field condition value is something like this: "choice_a.choice_b.name"
  2. Thanks for the fast fix Ryan. Just pushed a fix for this in the latest commit. Had to adjust the order that the operators were named in in the Javascript regex. I tried it and can confirm it works now the way you would expect. You mentioned that your page field only holds a single page. As a result, the above can't work since it is asking for all of those IDs to match at the same time. Such a scenario would only be possible with a multi-page field. Indeed you're right about that, i was thinking it would be looking if the d_product value was one of those values, but of course it is looking if the field has all those values. The OR syntax "|" in fields/values isn't yet supported for dependency selectors. I will be adding support for it, but not until everything else is considered stable with the dependencies. Basically, I'm trying to keep the number of variables at a minimum so that people can start using this stuff in a stable state sooner rather than later. I was'nt expecting it would work in this early stage. Yes, you're absolutely right
  3. Ah i forgot the actual error message... I created a field named test of the type Textarea, then editing it changing the type to Concat gives the following error message: Table 'processwire.field_test_pwtmp' doesn't exist
  4. I noticed this now a couple of time so i thought i would report this as a possible bug. When you have an existing field of the type Text, Textarea (possibly also Datetime, Email and URL) and trying to change the type to Concat it triggers a error message. I have tried this with a field of the type Textarea, then the Type pulldown has the following options: Concat Datatime Email Text Textarea URL After the error is shown i have tried again to modify the type from Textarea to Concat and that worked fine, no error. It looks like it has problem trying to modify a field that needs no actualy table in the database (concat field)
  5. Did some testing of the beta version and noticed a few things. In my template i have a field (d_product) with type of page that holds the product pages, the selection is limited to 1 page. Testing to show a certain field (d_nr) when the d_product page id is 1008, 1009, 1010 or 1011 This does work: d_product>1007,d_product<1012 This does'nt work: d_product>=1008,d_product<=1011 This also does'nt work: d_product=1008,d_product=1009,d_product=1010,d_product=1011 This does'nt work for now as expected (described in current limitations): d_product=1008|1009|1010|1011 Optimal would be if it could do something like the following. I saw this is planned for a future release. d_product.d_type_select.name='regioblad'
  6. Great work!, installing right now to do some testing
  7. Would this also work with fieldsets? That displaying a fieldsets is depended on a choice from lets say a checkbox or dropdown
  8. This is amazing. Can think of so many situations that this will come in handy.
  9. @horst thanks for these extra features in the watermarkLogo process. One question what does the 0 stand for?
  10. Thats great news, looking forward to give it a try when its finished. Using a pageImage object makes sence when its needed to rescale or in any other way pim modify the watermark in way go.
  11. @Martijn a path works fine, i needed to use $wmi->filename instead. $img = $page->images->first(); $wmi = $page->watermark; $imgsrc = $img->pimLoad('tw',true)->width(240)->watermarkLogoTiled($wmi->filename)->pimSave(); echo "<img src='{$imgsrc->url}' /><br />"; @horst it would be nice to be able to position the watermark image. I have used a small 50×50 px. In phpThumb it is possible to position the watermark image with the following values: LT - T - RT L - C - R LB - B - RB or to have it the ProcessWire way: northwest, north, northeast, west, center, east, southwest, south, southeast
  12. I'm probably doing something wrong, because i'm getting an error with trying the watermarkLogo and watermarkLogoTiled I was thinking the $pngAlphaImage has to be an image object or url so i tried both ways, with out any luck. $img = $page->images->first(); $wmi = $page->watermark; $imgsrc = $img->pimLoad('tw',true)->width(240)->watermarkLogoTiled($wmi->url)->pimSave(); echo "<img src='{$imgsrc->url}' /><br />"; Can you point out what i'm doing wrong? The error is below: Error: Exception: Cannot read the pngAlphaImageFile! (in /Users/user/Sites/www_domains/processwire/htdocs/site/modules/PageImageManipulator/ImageManipulator.class.php line 1271)
  13. This is looking very nice. I'm specificly interested in the watermark. Going to give it a try.
  14. Thanks adrian, i ididnt know github also serves older versions Hey Martijn how was the holidays? see you monday again.
  15. I need to do some testing and im in need for an "old" version op PW, namely 2.2.9 Is there a place where i can download older versions of PW?
  16. Im running Apache localy on a MacBook Pro for development. ProcessWire 2.3.0 System Darwin MAC-0010.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64 Server API Apache 2.0 Handler Apache Version Apache/2.2.22 (Unix) PHP/5.3.23 Loaded Modules core prefork http_core mod_so mod_authn_file mod_authz_host mod_cache mod_disk_cache mod_dumpio mod_reqtimeout mod_ext_filter mod_include mod_filter mod_substitute mod_deflate mod_log_config mod_log_forensic mod_logio mod_env mod_cern_meta mod_expires mod_headers mod_ident mod_usertrack mod_setenvif mod_version mod_proxy mod_proxy_http mod_proxy_balancer mod_mime mod_autoindex mod_asis mod_info mod_cgi mod_vhost_alias mod_negotiation mod_dir mod_imagemap mod_actions mod_speling mod_alias mod_rewrite mod_hfs_apple2 mod_userdir_apple mod_mem_cache mod_status mod_php5 MySQL Support Client API version mysqlnd 5.0.8-dev - 20102224 - $Id: 731e5b87ba42146a687c29995d2dfd8b4e40b325 $ User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:21.0) Gecko/20100101 Firefox/21.0
  17. Soma, that did the trick. I dont get any error messages anymore when cloning. Thanks for the solution
  18. I have tried cloning it manualy from the home template $clone = $pages->clone($pages->get('/test1/')); $clone->title = 'Test1 Clone'; $clone->name = 'test1-clone'; $clone->save(); But this also generated the following error: Error: Exception: Incorrect integer value: '' for column 'data_max' at row 1 (in /Users/user/Sites/www_domains/test/htdocs/klanten/wire/core/Database.php line 118) #0 /Users/user/Sites/www_domains/test/htdocs/klanten/wire/core/Fieldtype.php(537): Database->query('INSERT INTO `fi...') #1 [internal function]: Fieldtype->___savePageField(Object(Page), Object(Field)) #2 /Users/user/Sites/www_domains/test/htdocs/klanten/wire/core/Wire.php(271): call_user_func_array(Array, Array) #3 /Users/user/Sites/www_domains/test/htdocs/klanten/wire/core/Wire.php(229): Wire->runHooks('savePageField', Array) #4 /Users/user/Sites/www_domains/test/htdocs/klanten/wire/core/Pages.php(576): Wire->__call('savePageField', Array) #5 /Users/user/Sites/www_domains/test/htdocs/klanten/wire/core/Pages.php(576): FieldtypeRangeSlider->savePageField(Object(Page), Object(Field)) #6 [internal function]: Pages->___save(Object(Page), Array) #7 /Users/user/Sites/www_domains/test/htdocs/klanten/wire/core/Wire.php(271): c This error message was shown because you are logged in as a Superuser. Error has been logged. As for now i wil replace the RangeSlider field with something else, that will do the job. Could be my localhost is the problem, i will try when its finished how it does on the server it will be hosted on.
  19. The values of the field logo_height of the type RangeSlider that was assigned to the template of the first page in the tree to be cloned Range: [unchecked] Slider width: 100 Default value: 100 Minimum Allowed Value: 50 Maximum Allowed Value: 200 Step: 1 Counter Prefix: [empty] Counter Suffix: px. The field was placed between a FieldsetTabOpen and FieldsetClose
  20. Thanks Soma for looking in to this and finding this. Yes the first page in the tree has a range slider on the template. I have removed the range slider from the template and now it clones the whole tree as expected. note: when i removed the range slider field from the template it also gave the error: Incorrect integer value: '' for column 'data_max' at row 1 Is this a bug in the range slider module or could it be i have to set some field in the configuration of the field?
  21. Im making a module to clone a pre defined page tree. This module is called CustomerStructureCloner. I have to fill in a new customer name that will be used as page title and page name. But im having dificulties with some error i dont understand: It clones the first page but not the children. It also doent rename the first page. But instead i get the following error message: Incorrect integer value: '' for column 'data_max' at row 1 Im using the following code inside the module: public function ___execute() { $error = $this->_("Unable to load page"); $id = 1005; // ID of /structure/customer/ if(!$id) throw new WireException("$error A"); $customer = $this->pages->get($id); $form = $this->modules->get("InputfieldForm"); $form->attr('action', './add/'); $form->attr('method', 'post'); $form->description = 'Vul hieronder de naam van de klant in.'; // Form description/headline $n = 1; $root = $this->pages->get('/'); while(count($root->children("include=all, name={'klantnaam'}-$n"))) $n++; $field = $this->modules->get("InputfieldPageTitle"); $field->attr('name', 'clone_page_title'); $field->attr('value', 'Klantnaam ' . sprintf($this->_n("(copy)", "(copy %d)", $n), $n)); // Phrase added to page title to make it unique $field->label = $this->_("Naam van de klant"); // Label for title field $description = "Vul hier een unieke klantnaam in. Deze klantnaam mag niet al bestaan. "; $description .= "Vervolgens wordt er een één-op-één copie gemaakt van de pagina %s en alle onderliggende pagina's"; $field->description = sprintf($this->_($description), $customer->path); // Form description/headline $form->add($field); $field = $this->modules->get("InputfieldSubmit"); $field->attr('name', 'submit_clone'); $form->add($field); return $form->render(); } /** * Called when the URL is this module's page URL + "/add/" * */ public function ___executeAdd() { $input = $this->input; // add a breadcrumb that returns to our main page $this->breadcrumbs->add(new Breadcrumb('../', 'Nieuwe klant toevoegen')); $error = $this->_("Unable to load page"); $id = 1005; // ID of /structure/customer/ if(!$id) throw new WireException("$error A"); $customer = $this->pages->get($id); $root = $this->pages->get('/'); $pageName = $this->sanitizer->pageName($input->post->clone_page_title); $nameTaken = count($root->children("name=$pageName, include=all")) > 0; $clone = $this->pages->clone($customer, $root); if(!$clone->id) throw new WireException(sprintf($this->_("Unable to clone page %s"), $customer->path)); if(strlen($pageName)) { if($nameTaken) $this->error(sprintf($this->_("The name '%s' was already taken, so one was automatically assigned."), $pageName)); else $clone->name = $pageName; $clone->title = $input->post->clone_page_title; $clone->save(); $this->message(sprintf($this->_('Cloned page "%1$s" to "%2$s"'), $customer->name, $clone->name)); } //$this->session->redirect($this->config->urls->admin . 'page/list/?open=' . $clone->id); } What could be the problem that it doesnt clone its children too and doesnt rename the page? Edit: A little update, All the pages templates to be cloned have the right "Family" settings, so they are allowed to be eachothers parent and/or children.
  22. Its the first time i have experienced this on the hosting. Never would have thought the site get so many visitors at once. If it happens once again it might indeed be time to implement that ProCache module that was mentioned in the topic that petsagouris posted. Thanks all for the explinations.
  23. Thanks, i read that topic. But what im actualy curious about is that somebody is trying to access the site on a url that not exists and as a user that not exists. Page: http://www.somedomain.nl/?/ User: ? Notice the questionmark in the URL and user. Its not the guest user as far i understand. I can imagine it was somekind of hack attempt of some sort.
  24. Since about 10 minutes ago i am receiving a few dozen notifications emails per minute from a site that is build in processwire. This is going on for about 15 minutes now. To me it looks like somebody is trying to do something else then just browing trough the website. The Error Notifications email is as follow Page: http://www.somedomain.nl/?/ User: ? Error Exception: DB connect error 1040 - Too many connections (in /var/www/vhosts/... .../wire/core/ProcessWire.php line 96) The website is working normaly and i can login to the manager without any problems. Has anybody else ever got this kind of notices and what could have caused it?
  25. Great idea's here. Would be nice to have the ability to add a watermark to an image. At the moment i'm using phpThumb class to achieve this.
  • Create New...