Jump to content

glitterBear

Members
  • Posts

    2
  • Joined

  • Last visited

glitterBear's Achievements

Newbie

Newbie (2/6)

0

Reputation

  1. Thanks a lot! That worked just fine!!! I didn't know I could use "page." to get the current page.
  2. Hi! I'm quite new to ProcessWire and today I stumbled over an error that occurred when I tried to define the selectable page for a PageSelectField: My situation: I have 2 PageSelectFields in a template. The first ist for research fields where only max 1 is selectable (Type: Page, Single Page(Page) or boolean false when none selected, Input field type: Select). The second PageSelectField is for sub-research-fields which are children of the research fields. The selectable pages here should be the children of the research field chosen in the first PageSelectField (research fields), so I defined the selectable pages here as follows: $selectables = new PageArray(); if(count($page->project_research_field_selector)>0) { $selectables = $page->project_research_field_selector; } return $selectables; Even though I return an empty PageArray in case no research field is selected (first PageSelectField) I only get the following error message: Fatal error: Call to a member function has() on a non-object in /var/www/processwire/wire/modules/Inputfield/InputfieldPage/InputfieldPage.module on line 253 It seems that the return value is still NULL or at least the call in line 253 (as mentioned above) does not work. My workaround for this was to surround line 253 with "if($children){ ... }" but I'm quite sure that this cannot be the solution. My Question: Where did I go wrong? Or is this actually a bug? Thanks in advance for your help!!!
×
×
  • Create New...