Jump to content

NorbertH

Members
  • Posts

    211
  • Joined

  • Last visited

Posts posted by NorbertH

  1. Hi all ,

    I get a "Headers already sent" when i call PW from the commandline. If i start output before including PW.
    I know that is an Issue if doing output in a webbrowser before starting the actual session but i did not expect this in a CLI call.

    Here is the script: 

    <?php  namespace ProcessWire;
    
    $path = "../../index.php";
    $path = realpath($path);
    
    echo ("\nPath: " .$path. "\n");
    include $path;
    

    Here is the Error:

    Path: /usr/local/www/apache24/noexec/mein-kaffe.de/processwire/index.php
    PHP Warning:  session_set_save_handler(): Cannot change save handler when headers already sent in /usr/local/www/apache24/noexec/mein-kaffe.de/processwire/wire/core/WireSessionHandler.php on line 57
    
    Warning: session_set_save_handler(): Cannot change save handler when headers already sent in /usr/local/www/apache24/noexec/mein-kaffe.de/processwire/wire/core/WireSessionHandler.php on line 57
    PHP Warning:  session_name(): Cannot change session name when headers already sent in /usr/local/www/apache24/noexec/mein-kaffe.de/processwire/wire/core/Session.php on line 286
    
    Warning: session_name(): Cannot change session name when headers already sent in /usr/local/www/apache24/noexec/mein-kaffe.de/processwire/wire/core/Session.php on line 286
    PHP Warning:  ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /usr/local/www/apache24/noexec/mein-kaffe.de/processwire/wire/core/Session.php on line 289
    
    Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /usr/local/www/apache24/noexec/mein-kaffe.de/processwire/wire/core/Session.php on line 289
    PHP Warning:  ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /usr/local/www/apache24/noexec/mein-kaffe.de/processwire/wire/core/Session.php on line 290
    
    Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /usr/local/www/apache24/noexec/mein-kaffe.de/processwire/wire/core/Session.php on line 290
    PHP Warning:  ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /usr/local/www/apache24/noexec/mein-kaffe.de/processwire/wire/core/Session.php on line 291
    
    Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /usr/local/www/apache24/noexec/mein-kaffe.de/processwire/wire/core/Session.php on line 291
    PHP Warning:  ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /usr/local/www/apache24/noexec/mein-kaffe.de/processwire/wire/core/Session.php on line 292
    
    Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /usr/local/www/apache24/noexec/mein-kaffe.de/processwire/wire/core/Session.php on line 292
    PHP Warning:  ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /usr/local/www/apache24/noexec/mein-kaffe.de/processwire/wire/core/Session.php on line 304
    
    Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /usr/local/www/apache24/noexec/mein-kaffe.de/processwire/wire/core/Session.php on line 304
    


    I am not sure but shouldn't the session be started when running from CLI ?


     

  2. Now its nice Yellow ....still with messages that should be green ....

    Bildschirmfoto_yellow.png.588831c868d2d93289857320325d0d91.png

     

    Edit: Forgot to say i Upgraded PW to 3.0.197 dev    and reinstalled the Less module ...

    // Primary color 
    @rock-primary: #9f2d2d;
    
    // Margins
    @global-margin: 10px; 
    @global-medium-margin: 5px;
    @global-small-margin: 3px;
    
    // Logo Größe
    .pw-logo {height: 60px !important;max-height: 60px !important;}
    .pw-logo-custom {max-height: 60px !important;height: 60px !important}
    
    @alert-primary-background: yellow;
    @alert-success-background: green;
    @alert-warning-background: orange;
    @alert-danger-background: red;

    The funny thing is when i set it to default template everything is perfectly OK

    Bildschirmfoto_2022-03-27_20-51-44.png.cd1fe776c3677c51a4ec14d800c9c39d.png

    Edit Forgot to mention i Upgraded PW to 3.0.197 dev and completely reinstalled the Less Module

  3. ... now all messages are yellow .... but still i am missing red and green

    i tried
    @alert-success-background:                     #32d296;
    @alert-warning-background:                     #faa05a;
    @alert-danger-background:                      #f0506e;

    But they are ignored... 

    When i tried :

    @global-success-background:                     #32d296;
    @global-warning-background:                     #faa05a;
    @global-danger-background:                      #f0506e;

    They got ignored too 😞

     

     

     

  4. As our software  department is heavily overworked we need to outsource some tasks. We are looking for someone who sets up a shop whith Processwire and extends it step by step. 

    Features needed right at the beginning:
    - Age verification on registration using german "Schufa" and identification via "Personalausweis" as fallback.
    - Registration form that is limited to certain countries.
    - Multiple attributes for products.
    - Multiple customer groups whith different prices.
    - Products are updated via uploaded CSV file that needs to be read into the system by cronjob.
    - Template is bought from Template Moster or similar source and needs to be connected to the Processwire system.
    - Export orders to Collmex (https://www.collmex.de/) Module for export can be done inhouse, as we have an example action for  Pagelister Pro already available.
    - Simple blog or news page
    - Some static pages for imprint, privacy policy, and several other pages needed by german laws.

    As the specifications may change to some extend, we aim for support on an hourly basis.
    All Modules and reusable elements that are created may be posted in the Processwire module directory. 

    For further questions just ask or PM me. 

  5. Actually i mostly use Linux too. 

    Just using a Xubuntu as it  is lacking most the cool and modern desktop effects i not really like. 

    Libre Office as it often is more "compatible" for opening office documents than Microsoft office itself. In addition it has far better support for CSV data files.

    Gimp for grafiks, Imagemagick for scripted image processing./creation.
    In addition Scribus and Inkscape for other tasks

    Vim, Mousepad, Atom, Jedit, PHP-Storm as editor/development environment. 

    Firefox / Thunderbird for web and communication.

    On the server side i  almost never used anything else than Linux/BSD. 
    Apache, NGINX, MariaDB, MySQL, PostgreSQL, PHP,  Perl, Python, Bash ....  

    What else do i need ? 😀

    • Like 1
    • Thanks 1
  6. Using this field in conjunction with a lister , i can select its subfields like width or height for the lister, but there is no content shown.

    The button field i although used seems to have this functionality , its subfields appear in the lister. But to be true i cant figure out whats wrong.

    screenshot-futuresteam.de-2019-07-21-01-07-35.png

  7. I tried to use this tool

    https://getuikit.com/v2/docs/customizer.html

    To modify the look of my BE template. Just made some changes , downloaded the .less file and added its content to the 

    theme.less 

    file. 

    This works good al long as i don't try to change some main colors.

    As far as i understand it you have made a copy of the default admin uikit theme , and then added a few extra variables (eg. to combine the color of the menubar and the main buttons into one var @tm-primary-color)

    Is it possible to just use a file whithout those modifications an completely rely on the UIKit Customizer ?

    Thanks in Advance!

     

     

     

     

     

     

     

  8. Hmmm , ok and concerning to Fields Array.php  Line 16

    Quote

    Per WireArray interface, only Field instances may be added

    So if we expect a fully  complete  $fields array all of those fields need to be initialized right at the beginning too ?

    The query itself shouldn't be so much time consuming?

    Do i see this correct having too many unused ,modules / templates does a simmilar slowdown ?

     

     

  9. Just, asking myself, why PW needs to load all fields and Templates at Startup. Schould be possible to store installed fileds/tamplates  in a DB and load this at startup , of possibly use some kind of autoloader? 

    Is there some documentation about the Bootstrap process?
    Possibly someone could point out where to find the relevant parts in the initialisation?

  10. Almost 100 % sure fetching all vars from a form, and put them into the page.

    Creating an empty page  , so i can add Profields Table (You cannot add this to a not saved page), set some other values like customer and delivery address , set the table with products and then save it again. 

            // Create page
    		$b = new Page();
    		$b->template="bestellung";
    		$bId= $b->save();
    		
    		// Set basic stats
    		$b->bestellung_user_select=$derCustomer;
    		$b->bestellung_liefer_addresse_select=$pages->get((int)$input->post->liefer_select);
    
    		if ($input->post->liefer_select=="3826" OR $input->post->liefer_select=="3827")
    			$b->bestellung_status_select=$pages->get(3829); // status Barverkauf
    		else
    			$b->bestellung_status_select=$pages->get(1047); // status bestellt
    		
    		$b->bemerkung_area=$bemerkung_area;
    		
    		
    		// Add articles (bestellung_artikel_table)
    		//$b->of(false); // turn off output formatting
    		foreach($myProducts as $prod) { 								
    			if (!empty($input->post->artikel[$prod->id]) AND 0< (int)$input->post->artikel[$prod->id]){
    				$art= $b->bestellung_artikel_table->makeBlankItem();
    				$art->artikel=$prod;
    				$art->stueck=$input->post->artikel[$prod->id];
    				$b->bestellung_artikel_table->add($art);
    				$b->save('bestellung_artikel_table');
    			}
    		}
    		
    		// save it all  
    		$b->save();
    		
    		// Show order successfull
    		$okBestellt=true;
    	
    		// Finally delete the post array , so the form is ready to go again  
    		$_POST=array();    // Global Post array
    		$input->post=null; //  Processwire post 
    		$aStueck=array();
    		$bemerkung_area="";
    	
    	} // END of order

    Very simple indeed. But it does its job. (Orderpage is just a simple frontend page) 

    Edit:

    Btw. have no changing field defined so it should not look after changes ?
    In the BE it kicks in without any changes.

    As a test workaround i simply made a CLI script that simply loads all pages that are not send , and then saves them again. the Hook then kicks in and sends the pages as he should.  

    $result=$pages->find('template=46, deny_export=0, bestellung_stueckzahl!="", bestellung_user_select.count!=0, bestellung_liefer_addresse_select.count!=0, bestellung_id_collmex="", limit=2');
    
    foreach ($result AS  $p) {
        echo $p->name."\n";
    	$p->save();
    }

     

     

     

  11. When saving a page with the "order" template in the backend  IftRunner is nice to me and sends the order via page action into my accounting software. 

    When saving "order" in a frontend page it does nothing.   So i certainly missing something . Any ideas? 

     

  12. Hey , just found that the Tracy Panel selector shows rendering time and memory consumtion of all the panels. 

    Maybe you like to see how this impacts on a slow system on my bigger server this is almost irrelevant. 

    Results for pagetree:

    Tracy.png.ed84a410cdf999a18daae18b736042ec.png

    I activated all for an overview .

    But you where right the Request Info was consuming most of my time , as it was active by default. 

     

  13. Double memmory has no effect (still only about 20Mb used ). Processor says 47% , so thats quite a lot.  

    Copying to another a more poverfull server helps alot , moved a nother application whith same problem recently. This is a very small box so the problem comes up very early i guess. But as soon as the application starts growing drastically(200+ fields) its always the same slowdown. Although bigger server can handle 200-300 fields.    

    This field/template loading would be a good thing for optimisation. I can not imagine why its necessary to load all Fields/Templates  every time.
    More and more people are building applications using PW and you cannot always avoid to add fields or templates.
    Maybe its possible to cache those field loads somehow or just load the fields needed ?

    But ok, so if you plan on a big applications right now its necessary to save fields and templates wherever you can ?

    What we have ...

    Reuse fields as often as possible.
    Eg. instead using one description field per dataset, generate 1 descriptions field and reuse it as often as possible.
    But what do i do f if i have a webshop where each client has a invoice address and a delivery address.  So the client needs a double set for adress data?  Somwhere i read that you should combine multiple fields into one, is there an easy example for doing this somewhere ? Another idea would be making an address template and  page fields to link the reused address fields groups to the client , but there is no clean solution for editing those addresses in the client page and this ad at least a template and 2 fields.
    What else can we do , and how to save templates ?      

     

×
×
  • Create New...