Jump to content

maba

Members
  • Posts

    167
  • Joined

  • Last visited

Posts posted by maba

  1. Hi,

    have you tested this great  :) module with ProCache (or default cache only)?

    On production I see a strange behaviour (= it does not work, no redirect) but if I clear or disable ProCache it works well.

    My default language isn't EN but IT, so it should redirect always to /en/ with a browser with HTTP_ACCEPT_LANGUAGE  != it.

    Thanks

  2. Hi,

    what is the right way to allow a translator to translate the whole content of a site in a new language?

    If the new language is hidden he cannot view the new language tab in translatable fields.

    If the new language isn't hidden we see it in front-end in language switch (example). Something like "unpublished" also for the language page.

    Thanks,

    Marco 

  3. Hi,

    I have a script that runs on crontab and update some fields.

    The problem is that when it runs from shell I got php notices from some modules:

    [28-Apr-2014 17:16:25 Europe/Rome] PHP Notice:  Undefined index: REQUEST_URI in /Users/maba/Workspace/src/aaa/site/modules/AdminHotKeys/AdminHotKeys.module on line 70
    [28-Apr-2014 17:16:25 Europe/Rome] PHP Notice:  Undefined index: REQUEST_URI in /Users/maba/Workspace/src/aaa/site/modules/ChromePhpLogger/ChromePhpLogger.module on line 51
    

    Ok, I can remove all warnings and notices but, is there a way to exclude or not load some modules when we include index.php?

    Thanks,

    Marco

  4. Same "problem" here but only when use PW in a shell script, latest dev.

    A repeater with 5 items (count = 5) used in a template returns 5 items. When call it in a shell script (that update dates and other things) it return 8 items (a problem when I want use its latest item to set a other fields, in this case 1/1/70).

    Your solution works well, but is this the correct behavior?

  5. Hi,

    in a multi language site (ITA - default - and ENG for now) I have an events template (and its events.php) with its child event template (no .php file).

    Events template loop all child and creates an accordion for each event.

    foreach(wire('pages')->find("template=event,date_end>=today,sort=date_start,limit=20") as $event)
    	$items .= _renderEvent($event);
    

    With this I can see all events in ITA but no events in ENG.

    foreach(wire('pages')->find("template=event,date_end>=today,include=all,sort=date_start,limit=20") as $event)
    	$items .= _renderEvent($event);
    

    With this I can see all events in ITA and ENG (add include=all).

    foreach(wire('pages')->find("template=event,sort=date_start,limit=20") as $event)
    	$items .= _renderEvent($event);
    

    (remove date_end<=) or

    foreach(wire('pages')->find("template=event,date_end<=today,sort=date_start,limit=20") as $event)
    	$items .= _renderEvent($event); 

    And also with this.. past events, obviously (change >= to <=).

    So.. why I cannot see future events in ENG but it works in ITA? All events are active also in ENG.

    Same result with superuser or guest (ProCache enabled but tried after clear cache).

    Latest dev.

    Thanks,

    Marco

  6. I have to create a "vertical" timeline made by photo posts, blog posts, gallery and other kinds of entries with the "load more" button at the bottom (to not refresh entire page). 
    Press "load more" and see a new (old) month (February 2014, January 2014, December 2013 ans so on).
     
    Probably I'll use Timeline plugin, from www.melonhtml5.com.
     
    I would have a suggest about how achieve this. 
    My json is like this (Timeline example):
     
    var timeline_data = [
        {
            type:        'blog_post',
            date:        '2011-08-03',
            dateFormat:  'DD MMMM YYYY',
            title:       'Blog Post',
            width:       400,
            content:     '',
            image:       'xxxx.jpg',
            readmore:    'http://www.example.com'
        },
        {
            type:        'slider',
            date:        '2010-12-16',
            dateFormat:  'DD MMMM YYYY',
            width:       400,
            height:      200,
            images:      ['xxx.jpg', 'xxx.jpg'],
            speed:       5000
        }
    ];
    
    I think that I should have a template that merge different pages in one array to create the json file (not all fields are homogeneous).
    But.. what is the right way to manage "load more" feature in this case?
     
    - use external json file (a template create it and save it in cache folder, like ModulesMananager does) 
    - use Pages Web Service (calling the page that does the job every "load more") 
    - other sort of pagination
    - idea?
     
    Thanks,
    Marco
  7. @ryan in \wire\core\Functions.php

    if(!wireChmod($dir->getPathname(), true, $chmod)) $numFails++;
    

    should be 

    if(!wireChmod($file->getPathname(), true, $chmod)) $numFails++;
    

    when install e new module I got dir undefined warning with PW 2.3.11.

    EDIT: issue on GitHub already fixed.

  8. This works:

    if(substr($module->download_url,0,8) == 'https://' && !extension_loaded('openssl')) {
        $actions = 'no openssl installed!';
    } else {
        if($action == 'edit') {
            $button = $this->modules->get('InputfieldMarkup');
            $url = "{$this->pages->get(21)->url}edit?name={$module->class_name}";
            $button->value = "<a href='$url' id='{$module->class_name}'>" . $this->_("edit") . "</a>";
        }
        else if($action == 'update') {
            $button = $this->modules->get('InputfieldMarkup');
            $url = "{$this->page->url}download/?url={$module->download_url}&class={$module->class_name}{$theme}";
            $button->value = "<a href='$url'$confirm id='{$module->class_name}'>" . $this->_("update") . "</a>";
        }
        // else if($action == 'download') {
        //  $button = $this->modules->get('InputfieldMarkup');
        //  $url = "{$this->page->url}download/?url={$module->download_url}&class={$module->class_name}{$theme}";
        //  $button->value = "<a href='$url'$confirm id='{$module->class_name}'>" . $this->_("download") . "</a>";
    
        // }
        else if($action == 'install') {
            $button = $this->modules->get('InputfieldMarkup');
            $button->value = "<button name='install' value='{$module->class_name}'>" . $this->_("install") . "</button>";
        }
        else if($action == 'not_install') {
            $button = $this->modules->get('InputfieldMarkup');
            $button->value = "<button name='not_install' disabled='disabled' value='{$module->class_name}'><s>" . $this->_("install") . "</s></button>";
        } 
        else {
            $button = $this->modules->get('InputfieldMarkup');
            $url = "{$this->page->url}download/?url={$module->download_url}&class={$module->class_name}{$theme}";
            $button->value = "<a href='$url'$confirm id='{$module->class_name}'>" . $this->_("download") . "</a>";
        }
    
        $actions = $button->render();
    }
    

    Only once!

    Tests ended.

  9. if ($button = $this->modules->get('InputfieldMarkup'))
    throw new WireException('Test Exception');
     TemplateFile: Test Exception
    #0 /my/installation/path/site/modules/ModulesManager/ModulesManager.module(260): ModulesManager->getActions(Object(stdClass), false, 'download', '')
    #1 /my/installation/path/wire/core/ProcessController.php(196): ModulesManager->execute()
    #2 [internal function]: ProcessController->___execute()
    #3 /my/installation/path/wire/core/Wire.php(359): call_user_func_array(Array, Array)
    #4 /my/installation/path/wire/core/Wire.php(317): Wire->runHooks('execute', Array)
    #5 /my/installation/path/wire/core/admin.php(49): Wire->__call('execute', Array)
    #6 /my/installation/path/wire/core/admin.php(49): ProcessController->execute()
    #7 /my/installation/path/site/templates-admin/controller.php(13): require('/my/installatio...')
    #8 /my/installation/path/site/templates/admin.php(13): require('/my/installatio...')
    #9 /my/installation/path/wire/core/TemplateFile.php(139): require('/my/installatio...')
    #10 [internal function]: TemplateFile->___render()
    #11 /my/installation/path/wire/core/Wire.php(359): call_user_func_array(Array, Array)
    #12 /my/installation/path/wire/core/Wire.php(317): Wire->runHooks('render', Array)
    #13 /my/installation/path/wire/modules/PageRender.module(333): Wire->__call('render', Array)
    #14 /my/installation/path/wire/modules/PageRender.module(333): TemplateFile->render()
    #15 [internal function]: PageRender->___renderPage(Object(HookEvent))
    #16 /my/installation/path/wire/core/Wire.php(359): call_user_func_array(Array, Array)
    #17 /my/installation/path/wire/core/Wire.php(317): Wire->runHooks('renderPage', Array)
    #18 /my/installation/path/wire/core/Wire.php(381): Wire->__call('renderPage', Array)
    #19 /my/installation/path/wire/core/Wire.php(381): PageRender->renderPage(Object(HookEvent))
    #20 /my/installation/path/wire/core/Wire.php(317): Wire->runHooks('render', Array)
    #21 /my/installation/path/wire/modules/Process/ProcessPageView.module(113): Wire->__call('render', Array)
    #22 /my/installation/path/wire/modules/Process/ProcessPageView.module(113): Page->render()
    #23 [internal function]: ProcessPageView->___execute()
    #24 /my/installation/path/wire/core/Wire.php(359): call_user_func_array(Array, Array)
    #25 /my/installation/path/wire/core/Wire.php(317): Wire->runHooks('execute', Array)
    #26 /my/installation/path/index.php(192): Wire->__call('execute', Array)
    #27 /my/installation/path/index.php(192): ProcessPageView->execute()
    #28 {main}
     

    Silly test.. PW works.

  10. Debug in on, with error_reporting settings but.. no way.

    No http, php (and mysql) errors.

    PW logs are clean.

    Yes, unbelievable. $modules->get fails only with this action.

    Tried with 3 PHP version.

    Copied a fresh "wire" folder: same issue.

    // $button = $this->modules->get('InputfieldMarkup');
    
    echo "URL: " . $this->page->url() . '<br>';
    echo "D_URL: " . $module->download_url . '<br>';
    echo "Module: " . $module->class_name . '<br>';
    echo "Theme: " . $theme . '<br>';
    
    $url = "{$this->page->url}download/?url={$module->download_url}&class={$module->class_name}{$theme}";
    
    //$button->value = "<a href='$url'$confirm id='{$module->class_name}'>" . $this->_("download") . "</a>";
    

    Works.. If I comment out $button.. the "loop" starts.

  11. Hard time also for my english probably.

    Problems beginning with a PW update. ModulesManager was the first module affected (and after Export Profile). I think that I can exclude any related memory or permission issues.

    Site works well but in admin I have all these problems.  :(

    Says about to remove all other modules only for test.. (Modules Manager compares installed and available version of a module, maybe..)

    At least.. we catch a little bug in ModulesManager.

×
×
  • Create New...