Jump to content

Peter Troeger

Members
  • Posts

    70
  • Joined

  • Last visited

Posts posted by Peter Troeger

  1. Since Updating to the latest Processwire Version 3.0.210 I get the following error. I've have this website running since processwire 2.2.

    Has anyone else experienced this or an idea what the problem might be?

    Thanks!
    Peter

     

    Fatal Error: Uncaught Error: Undefined constant "languages" in site/templates/admin.php:39
    
    #0 wire/core/WireHooks.php (1051): TemplateFile->{closure}()
    #1 wire/core/Wire.php (484): WireHooks->runHooks()
    #2 wire/core/PagesEditor.php (787): Wire->__call()
    #3 wire/core/PagesEditor.php (478): PagesEditor->savePageFinish()
    #4 wire/core/Pages.php (840): PagesEditor->save()
    #5 wire/core/Wire.php (419): Pages->___save()
    #6 wire/core/WireHooks.php (952): Wire->_callMethod()
    #7 wire/core/Wire.php (484): WireHooks->runHooks()
    #8 wire/core/PagesEditor.php (1235): Wire->__call()
    #9 wire/core/Pages.php (1017): PagesEditor->_clone()
    #10 wire/core/Wire.php (422): Pages->___clone()
    #11 wire/core/WireHooks.php (952): Wire->_callMethod()
    #12 wire/core/Wire.php (484): WireHooks->runHooks()
    #13 wire/modules/Process/ProcessPageClone.module (363): Wire->__call()
    #14 wire/core/Wire.php (413): ProcessPageClone->___process()
    #15 wire/core/WireHooks.php (952): Wire->_callMethod()
    #16 wire/core/Wire.php (484): WireHooks->runHooks()
    #17 wire/modules/Process/ProcessPageClone.module (130): Wire->__call()
    #18 wire/core/Wire.php (413): ProcessPageClone->___execute()
    #19 wire/core/WireHooks.php (952): Wire->_callMethod()
    #20 wire/core/Wire.php (484): WireHooks->runHooks()
    #21 wire/core/ProcessController.php (350): Wire->__call()
    #22 wire/core/Wire.php (413): ProcessController->___execute()
    #23 wire/core/WireHooks.php (952): Wire->_callMethod()
    #24 wire/core/Wire.php (484): WireHooks->runHooks()
    #25 wire/core/admin.php (160): Wire->__call()
    #26 wire/modules/AdminTheme/AdminThemeDefault/controller.php (13): require('...')
    #27 site/templates/admin.php (101): require('...')
    #28 wire/core/TemplateFile.php (328): require('...')
    #29 wire/core/Wire.php (413): TemplateFile->___render()
    #30 wire/core/WireHooks.php (952): Wire->_callMethod()
    #31 wire/core/Wire.php (484): WireHooks->runHooks()
    #32 wire/modules/PageRender.module (575): Wire->__call()
    #33 wire/core/Wire.php (416): PageRender->___renderPage()
    #34 wire/core/WireHooks.php (952): Wire->_callMethod()
    #35 wire/core/Wire.php (484): WireHooks->runHooks()
    #36 wire/core/WireHooks.php (1060): Wire->__call()
    #37 wire/core/Wire.php (484): WireHooks->runHooks()
    #38 wire/modules/Process/ProcessPageView.module (184): Wire->__call()
    #39 wire/modules/Process/ProcessPageView.module (114): ProcessPageView->renderPage()
    #40 wire/core/Wire.php (416): ProcessPageView->___execute()
    #41 wire/core/WireHooks.php (952): Wire->_callMethod()
    #42 wire/core/Wire.php (484): WireHooks->runHooks()
    #43 index.php (55): Wire->__call()
    #44 {main}
    thrown (line 39 of site/templates/admin.php)

     

  2. Hi ?

    I was wondering whether

    1. it is possible to change displayed name of the 'name'-field that is used as login-name for users? I'm using an ID as the login-name and would like to have it displayed as 'ID-db' instead of 'name' in the dropdowns etc.
    2. When opening the 'users'-View, can I change the default columns that are displayed? atm it uses fields that are not very helpful, and changing them every time I open it (Access->Users) is very tedious.

    Thank you, any help is appreciated! ?

    - Peter

  3. Well, I have this in the sidebar:

    <?php $aktuelles = $pages->find('template=blog-post, limit=4');
    							
    							foreach($aktuelles as $aktuell) {
    								$aktuell_body = $aktuell->get('summary|body');
    								$aktuell_title = $aktuell->title;
    								$aktuell_url = $aktuell->url;
    								$cat = $pages->get('/'.$pages->get('id='.$aktuell->categories[0])->name.'/');
    								echo '<div>
    									<div class="post">
    										<p class="date">'.$aktuell_title.'</p> 
    										<div class="text">';
    											$aktuell_body = strip_tags($aktuell_body, '<a><strong><em><i>');
    											echo truncate_words($aktuell_body, 22); 
    										echo '</div>
    									</div>';
    									
    									if($aktuell->categories!='') echo '<a href="'.$cat->url.'">'.__('Weitere Informationen unter ').$cat->title.'</a>';
    									
    								echo '</div>';
    							}
    							
    ?>

    and this is the main content with the pagination:

    <?php
    $children = $page->children('limit=3');
    foreach($children as $child) {
    			$title = $child->title;
    			$url = $child->url;
    			
    			echo '<h2><a href="'.$url.'">'.$title.'</a></h2>';
    			$grandchildren = $child->children();
    			foreach($grandchildren as $grandchild) {
    				$grandchild_title = $grandchild->title;
    				$grandchild_body = $grandchild->body;
    				$grandchild_date = $grandchild->date_freeform;
    				echo '<section class="mitteilung veranstaltung">
    				<h3>'.$grandchild_title.'</h3>
    				<p class="date"><em>'.$grandchild_date.'</em></p>
    				<p>'.$grandchild_body.'</p>
    				</section>';
    			}
    			
    		}
    	?> 
    			
    			
    <?php echo $children->renderPager(); ?>	

     

  4. Hello Community ?

    Has anyone ever tried having multiple elements on one page that get their info with $pages->find('selector, limit=n') and tried using pagination on one of these elements without effecting the other?

    I have a slider on a page where I display content with pagination. But when I go to page two, the slider content also goes to page two, which I don't want it to do ?

    Any tips are greatly appreciated!

    Thanks!

    -Peter

  5. I found out that, if I remove uikit from my site, the page is not redirected, but stays on ' .parent-page/page2/ '.
    It doesn't show the content from page 2 though. It still shows page 1 content.

    This is the complete template page.

    <?php namespace ProcessWire; 
    
    ?>
    
    <div id="body_text">
    
    	<?php
    	
    		$children = $page->children('start=0, limit=2');
    		
    		foreach($children as $child) {
    			$title = $child->title;
    			$body = $child->body;
    			$file = $child->file;
    			$file_url = $file['url'];
    			$image = $child->single_images;
    			if ($file=='') $file='#'; 
    			
    			
    			?>
    			
    			<section class="mitteilung">
    			
    			<?php
    			
    			echo '<h2><a href="'.$file_url.'">'.$child->title.'</a></h2>
    			<p>'.$body.'</p></section>';
    			
    		}
    	?> 
    			
    			
    			<?php echo $children->renderPager(); ?>
    </div>

    In the init file I add the uikit file.

  6. Thanks for your reply!

    • I have 32 child pages, and it generates the navigation correctly with multiple pages.
    • I added a start, but that didn't change it.
    • URL settings are set to blank for the default and pt for the second language. I tried changing the default to de, just in case but the problem still exists.
    • debug is already enabled. No errors are logged.

    I only have menubuilder and the login/register plugin for sitewide modules installed. Could it have anything to do with PagePathHistory?

  7. Hello ?

    I have set up pagination on a mulitlanguage site.
    I've done this before, but this time I have a problem I can't solve.
    Pagination is activated on 'parent-template' and 'child-template' just to be sure ?

    This is my code:

    $children = $page->children('limit=1');
    		
    foreach($children as $child) {
    	$title = $child->title;
    	echo $title;
    }
    		
    echo $children->renderPager();

    The navigation is output correctly and the link look correct as well 'parent-page/page2/'.
    But when I click the link, the site seems to redirect back to 'parent-page/

    Any help would be greatly appreciated ?

    - Peter

  8. I started anew, and the batch processor module was a problem.

    But now my login isn't working. I log in, in my log files I see a successful login, but The login page just reloads without a message.
    When entering wrong input details, I get the correct error message.

    Any ideas? ?

    Thank you!
    Peter

     

  9. Hello ?

    After upgrading to 3.0.123 from 2.7.2 (I replaced the wire folder, index.php and .htaccess I get this error:

    Fatal error: Uncaught Error: Call to a member function get() on null in site/assets/cache/FileCompiler/site/modules/ProcessBatcher/ProcessBatcher.module:58 Stack trace: #0 [internal function]: ProcessBatcher::getModuleInfo() #1 dev/wire/core/Modules.php(2568): call_user_func(Array) #2 wire/core/Modules.php(2844): ProcessWire\Modules->getModuleInfoInternal('ProcessBatcher', '\\') #3 dev/wire/core/Modules.php(1036): ProcessWire\Modules->getModuleInfo('ProcessBatcher') #4 dev/wire/core/Modules.php(848): ProcessWire\Modules->loadModule('...', '...', Array, Array) #5 wire/core/Modules.php(369): ProcessWire\Modules->load('...') #6 wire/core/ProcessWire.php(395): ProcessWire\Modules->init() #7 wire in site/assets/cache/FileCompiler/site/modules/ProcessBatcher/ProcessBatcher.module on line 58 

    When I disable template and file compilation, I get

    Fatal Error: Class 'Textformatter' not found (line 17 of site/modules/TextformatterMakeLinks.module)

    I added this to all my template files

    <?php namespace ProcessWire;

    And am not sure where to go from here ?

    Any help is greatly appreciated!

    Thanks!
    Peter

  10. @flydev no tracyDebugger installed.

    My processwire Version is  3.0.121

     

    When I add your code modified like this:

    $jobID = 0;
    $jobID = wire()->input->get->job;
    echo $jobID;
    
    $jobID = 0;
    $jobID = $wire->input->get->job;
    echo $jobID;
    
    $jobID = 0;
    $jobID = $input->get->job;
    echo $jobID;

    every echo outputs the ID correctly (must have had a spelling error before).
    But still not working in my $wire->addHookAfter('InputfieldHidden::render', function($event) use($jobID) {

    oh, and it also works fine with addHookProperty.

  11. 16 hours ago, BitPoet said:

    Any change if you remove the ampersand from your use() statement?

    No change. Tried that as well.

     

    16 hours ago, flydev said:

    $jobID = $wire->input->get->job;

     

    More infos :

     

    @BitPoet I think he is outside template 

    That's right, I'm in ready.php

    When I add $wire->  I get the following error: Notice: Trying to get property of non-object.

    Any other ideas? ?

     

  12. Hi ?

    I encountered a new problem I don't understand and have been trying to solve for the last few hours.

    I'm trying to pass a _GET variable to a hook, but maybe the hook is executed before the get variables can be used?

    This is my code:

    	$jobID = $input->get->job;
    
    	//$jobID = '1033'; <- when I do it like this, everything works perfectly.
    
    	$activeJob = $pages->get($jobID); 
    	$temp_value = $activeJob->id.' - '.$activeJob->title;
    	echo $temp_value; //outputs expected string '1033 - Job Title'
    
    	$wire->addHookAfter('InputfieldHidden::render', function($event) use(&$activeJob) {
    		if($event->object->name == 'job_titel_und_nummer') {
    			$temp_value = $activeJob->id.' - '.$activeJob->title;
    			echo $temp_value;  //outputs '0 - ', so nothing
    			$event->object->set('value', $temp_value);
    		}
    	});

    As always, any help greatly appreciated! Thank you!

    Peter

  13. I tried something different. And while it doen't work either, at least something happens ?

    $wire->addHookBefore('InputfieldPage::render', function($event) {
      if($event->object->name == 'job_waehlen') {
    	$event->object->set('defaultValue', '1033');
      }
    });

    I changed 'addHookAfter' to 'addHookBefore' and the method to 'InputfieldPage::render'. Now the Hook actually seems to trigger and so something.
    So then I found out that there's a value called 'defaultValue', which I was able to change, but it doesn't seem to have an effect on my Dropdown. It still doesn't preselect anything. ?

  14. Hi flydev,

    thanks for your Feedback!

    It's not working for me. In my dropdown I have two pages. One has as a value '1033', the other '1036'.
    The Dropdowns name is 'job_waehlen'.

    Even when I put $event->return->value = $this->pages->get(1033); The Dropdown doesn't preselect anything.<

    Is my method ('InputfieldPage::processInput') possibly the wrong one for a dropdown input field?

    - Peter

  15. Hi ?

    I'm trying my hands on hooks and was hoping to figure out how to set the default value of a page-select-dropdown of a form, created with formBuilder, via a hook.

    I want it to be dynamic, so I don't want to set it fixed in the formBuilder Menu.

    I tried something like this, but I don't know what to set as method and whether I should return a page or an id:

    $wire->addHookAfter('InputfieldPage::processInput', function($event) {
      if($event->object->name == 'job_waehlen') {
        $event->return = '1036';
      }
    });

    Any hints and help are greatly appreciated ?
    Thanks!

    - Peter

×
×
  • Create New...