Jump to content

Mirza

Members
  • Posts

    32
  • Joined

  • Last visited

Posts posted by Mirza

  1. Hi All,

    Thanks for all the replies.

    * We have already enabled the opcode.

    * We are using PHP 7.2.6 already.

    * Also, We have paid lister pro people are using it already.

    * We have used ProCache also, but not much help.

    * Our server Process Memory is going high as 2.5GB, Can you please advice/suggest us how to optimize.

    * Our Db health is good.

    * Php-fpm process memory is going high.

    @Robin S We are not using any website against this, it's just a centralized data so Profiler will not help us.

    This system will just import from JSON and export to JSON using cronjobs. We have also the paid profiler as well, but not helpful.

    Is there any module where I can monitor processes running currently?

    Appreciate your support on this.

    Thanks in advance.

  2. Hi All,

    Hope you are all doing good.

    We have the system which has 12 Million pages, We have used ProCache also, but not much help.

    We have 40+ agents are working on the pages.

    Our server Process Memory is going high as 2.5GB, Can you please advice/suggest us how to optimize.

    Our Db health is good.

    Php-fpm process memory is going high.

    We are using the ListerPro as well.

     

    Is there any module where I can monitor processes running currently?

     

    Appreciate your support on this.

    Thanks in advance.

    • Confused 1
  3. Hi, Awesome's,

    I am writing this post since I am facing the issue of performing slow admin panel.

     

    Let me give a background, we have 40+ people adding content into the admin panel, we have pages around 1.5 million.

     

    When people working all together in this system, we are facing the slow performance or PHP(fpm) consumption is getting higher.

     

    Please give me any suggestions, on how to optimize an admin panel to accommodate 1.5 Million pages or more.

  4. Hi Webhoes,

    Hope you are doing good :)

    Please find the below corrected piece of code.

     

    <?php
    
    namespace ProcessWire;
    
    /**
     * @global Sanitizer  $sanitizer
     * @global Inputfield $input
     * @global Page       $page
     * @global Page       $pages
     */
    
    //if user has send a form you can use $input rather that $_POST
    if ($input->post->aFormFieldName) {
        //create page if form submitted
        $p = new Page();
        $p->setOutputFormatting(false);
        $p->parent   = $sanitizer->selectorField($_POST['country']);//Country should exists in the page tree
        $p->template = 'population'; // example template
    
        $p->title = $sanitizer->pageName($input->post->name);
        $p->name  = $sanitizer->pageName($input->post->name);
        $p->email  = $sanitizer->pageName($input->post->email);
        $p->body  = $sanitizer->text($input->post->body);
        $p->save();
    
        echo "page ID {$p->id} created!<br>";
    
        return;  // stop with template code here
    }
    
    ?>
        <h4>Add a sighting</h4>
        <form method="post" action='<?php echo $page->url; ?>'>
            Location <input type="text" name="name"><br>
            Country <select name="country">
                <?php foreach ($pages->get(1022)->children as $country) {
                    echo '<option value="' . $country->id . '>' . $country->title . '</option>';
                } ?>
            </select>
            Subspecie <select name="subspecie">
                <?php foreach ($pages->get(1027)->children as $subspecie) {
                    echo '<option value="' . $subspecie->id . '>' . $subspecie->title . '</option>';
                } ?>
            </select>
            Remark <input type="text" name="body">
            E-mail: <input type="text" name="email"><br>
            <input type="submit" name="aFormFieldName" />
        </form>

    Please check if it helps.

    • Like 2
  5. Hi All,

    I am trying to include the unit tests into our project which is in Processwire(I love it).

    Directory structure for the same will be shown below

    5a12ba75d3c46_ScreenShot2017-11-20at3_16_27PM.png.3408f9d16a8fd6e79d0be91105fb19a9.png

     

    Here PWTestCase.php is the parent file where it is getting inherited from the PHPUNIT framework TestCase class and It is in same namespace ProcessWire; as shown below

    5a12bb0a57bea_ScreenShot2017-11-20at3_22_22PM.png.55cafb147b34e9274de7458816e443a6.png

    Now I have a basic unit test(FuncTest.php as shown below) to check the language calling the function getLanguage() residing in site/templates/_func.php.

    5a12bc91352a4_ScreenShot2017-11-20at3_28_25PM.png.0cf8e46be976f0892c32f7c95c59983f.png

    ***when try to run this test, getting undefined function getLanguage as shown below***

    5a12bcb83c126_ScreenShot2017-11-20at3_26_46PM.png.6fb724f6f8cff5d9addee399ee650c64.png

     

    Since I am using namespace ProcessWire; & bootstraping processwire in PWTestCase why i am not able to access functions? Can you please suggest where i am going wrong?

    Thanks in advance.

  6. 3 hours ago, Zeka said:

    As far as I know, there is no multilanguage support. As workaround, if I'm not mistaken you, can switch user language in admin and then make import of your pages. They will be imported into the selected language. 

    Thanks for the response, But that didn't work, page name should be in english.

    Trying for another solution.

  7. Hi All,

    Arabic content changes not available in page getChanges method

    While editing the page from admin panel in the multi-language field, added a hook to save the changes made to the page.

     

    $this->pages->addHookAfter('saveReady', $this, 'hookUpdateLog');

     

    public function hookUpdateLog(HookEvent $event) {
        $page = $event->arguments[0];
    
        if(in_array($page->template->name, $this->templateList)) {
            $this->logFieldChanges($page);
        }
    }
    public function logFieldChanges($page) {
        $changes = $page->getChanges(); //This changes does not contain the field of arabic changes.

    }

    Please let me know, If I am approaching in a right way.

    Screen Shot 2017-11-14 at 10.50.21 AM.png

  8. 10 minutes ago, Sérgio Jardim said:

    You probably set your publish_date field to automatically set a default date (NOW()) on page save.  

    I have not set any value to the publish field on page save, I do checked the pages table schema which has default null value.

    Might be any module which has a hook will be affecting, Let me give a try.

  9. Hi All,

    I have created a script which will create the pages and it should be unpublished.

    I have added the status as unpublished by default while first time saving the page as below.

    $hotelPage->hotel_website = $hotel['hotelWebsite'];
    
    // By default page created will be unpublished state
    $hotelPage->addStatus(Page::statusUnpublished);
    
    $hotelPage->save();
    $hotelPage->setOutputFormatting(false);
    // Add hotel images only after setting output formatting to false
    $hotelPage->images->add($hotel['hotelImage']);
    $hotelPage->save();

    On the same time, saving the hotel image as well and triggering the save method.

    But when I see the created page in the tree, Its shows unpublished but publish_date is not empty(date will be present as created, modified and published are all same)

    Now I don't understand why the date is getting filled into the publish field for a page?

    Please let me know if am doing something wrong.

  10. Hi All,

    Current I have a field with page reference type.

    Which is showing everything in one column like

    1

    2

    3

    4

    5

    6

    How can we specify the check boxes to show like 

    1    2

    3    4

    5    6

    is it possible to obtain these in the admin panel?

     

    5975f12b5ac1e_ScreenShot2017-07-24at5_02_04PM.thumb.png.a78a5bca628ea79b63d725e90799de1d.png

  11. Hi All,

    I have a processwire setup for multi language which is english and arabic.

    I have a template called hotel which has title field act as hotel name for both EN & AR language.

    Since a week ago I was getting the error in 

     

    Quote

    SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '88-14191' for key 'name1056_parent_id'

    Since we have key  in pages table which states as below

    Quote

    UNIQUE KEY `name1056_parent_id` (`name1056`,`parent_id`),

    So the field name1056 should store the Arabic value of the title field.

    But its not storing the arabic value, since we have CHARACTER SET ascii for the field `name1056` as below

    Quote

      `name1056` varchar(128) CHARACTER SET ascii DEFAULT NULL,

    Can anyone explain me 

    * On what basis character set is defined?

    * Is there any specific reason for setting the ASCII character set?

     

    Thanks in advance for the help.

  12. Hi, Even I am facing the same issue, do we have any solution for this?

    I have a field which holds multi language called hotel name when it tries to change the Arabic name to some other value and save it says the below error and Arabic field value not saved.

    Quote

    SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '88-14191' for key 'name1056_parent_id'

     
     

    When I checked in DB pages table has unique key   

    Quote

    UNIQUE KEY `name1056_parent_id` (`name1056`,`parent_id`),

    as shown in the attachment.

    The value for field name1056 is null but It has value saved for Arabic text already.

    Now, I am stuck with this issue, anyone has any solution to this?

     

    Screen Shot 2017-07-24 at 1.52.43 PM.png

×
×
  • Create New...