We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41941
    • 1 Posts
    Hi

    In the last week or so I have run into issues with snippets, as soon as there is an code of interest in the snippet it will not save and dots appear down the side of the menu.

    if i manually edit the moxd_snippets record i can force the code in but when i try to use the snippet i then get

    Parse error: syntax error, unexpected '<' in /home/mysite/public_html/core/cache/includes/elements/modsnippet/38.include.cache.php on line 7

    I'm currently trying to work though Bob Rays tutorial for CreateXpdoClasses and im just pasting in tried and tested code so im pretty sure its not my code that wrong.

    http://bobsguides.com/custom-db-tables.html the code for the CreateXpdoClasses triggers the issue.

    With all the snippet problems i have had i have subverted them buy putting the code in static snippets instead which work no problem so I wondered could i have broken the manager? everything else works fine im using just upgraded 2.2.5 and first noticed issue last week then i was on 2.2.2.

    Any clues would be much appreciated has anyone seen this before

    The piece of code later in the tutorial has worked without crashing my manager and I have not had to make that into a static snippet, I'm now going to start looking at the code to see where the conflict is coming from, as there must be something in the first snippit that causes it to conflict/crash

    <?php
    $path = MODX_CORE_PATH . 'components/quotes/';
    $result = $modx->addPackage('quotes',$path . 'model/','bobs_');
    if (! $result) {
    return 'failed to add package';
    } else {
    $output = '<p>added Package</p>';
    }

    $quotes = $modx->getCollection('Quotation');

    $output .= '<p>Total: '. count($quotes) . '</p>';

    foreach($quotes as $quote) {

    $output .= '<p>Topic: ' . $quote->get('topic');
    $output .= '
    Quote: ' . $quote->get('quote');
    $output .= '
    Author: ' . $quote->get('author') . '
    </p>';
    } [ed. note: mikethepike1975 last edited this post 13 years, 10 months ago.]