Posts by kdl

    Hi Drew,


    Removing the @ from the 'Your Twitter username' in the perch twitter settings page, still produces all of the aforementioned errors. It's still failing at this line 163 item within PerchTwitter.class.php.


    I will try going back to using a custom call for the rendering of the tweets, as this was the only place that HAD used the @KLSupportUK name, but I cannot see this being any part of the issue.

    OK MAYBE GETTING SOMEWHERE.


    If I clear the perch3_twitter_tweets table and remove the below code from PerchTwitter.class.php (line 162 - 166):

    Code
    1. if (!isset($item->error)) {
    2. return $item->html;
    3. }
    4. return -1;

    Then press 'Get Tweets', the tweets import without error and I can see the raw html on the site !!!.

    It's something !!!!!!


    So, the Million Dollar Question is, why does the above code trigger all these issues ? and what could I try to resolve it.

    OK MAYBE GETTING SOMEWHERE.


    If I clear the perch3_twitter_tweets table and remove the below code from PerchTwitter.class.php (line 162 - 166):

    Code
    1. if (!isset($item->error)) {
    2. return $item->html;
    3. }
    4. return -1;

    Then press 'Get Tweets', the tweets import without error and I can see the raw html on the site !!!.

    It's something !!!!!!


    So, the Million Dollar Question is, why does the above code trigger all these issues ? and what could I try to resolve it.

    This is getting so frustrating.


    I decided to delete the 'Twitter App' and rebuild it.


    I gave the app the actual site url, but the callback is for my locally hosted version with the additional item route to the settings:


    Quote

    http://[mylocaldomain]/admin/addons/apps/perch_twitter/settings/

    New App Authenticates fine...yay.


    But as soon as I go to retrieve Tweets I get ALL the errors mentioned above, so something is definitely not right, especially if there is a known bug in the Perch Twitter App that requires this additional routing to the callbackURL. Surely other people are finding this. Maybe they are just not using the Twitter App ? Might have to look at some alternative.


    Usual errors when pressing 'Get Tweets':

    Quote

    Notice: Trying to get property of non-object in C:\KDL-Projects\Open\kdl_kls\www\admin\addons\apps\perch_twitter\PerchTwitter.class.php on line 163


    Warning: Cannot modify header information - headers already sent by (output started at C:\KDL-Projects\Open\kdl_kls\www\admin\addons\apps\perch_twitter\PerchTwitter.class.php:163) in C:\KDL-Projects\Open\kdl_kls\www\admin\core\lib\PerchUtil.class.php on line 1405


    Warning: Cannot modify header information - headers already sent by (output started at C:\KDL-Projects\Open\kdl_kls\www\admin\addons\apps\perch_twitter\PerchTwitter.class.php:163) in C:\KDL-Projects\Open\kdl_kls\www\admin\core\inc\top.php on line 17


    The perch3_twitter_tweets table gets updated with all the tweets and I can see them in the Admin (Listing Tweets page), so the app has downloaded and worked, so it MUST be perch side.


    The DEBUG shows:

    Code
    1. Array
    2. (
    3. [type] => 2
    4. [message] => Cannot modify header information - headers already sent by (output started at C:\KDL-Projects\Open\kdl_kls\www\admin\addons\apps\perch_twitter\PerchTwitter.class.php:163)
    5. [file] => C:\KDL-Projects\Open\kdl_kls\www\admin\core\inc\top.php
    6. [line] => 17
    7. )

    which points to this mysterious issue around line 163, but all this has is:

    Code
    1. if (!isset($item->error)) {
    2.     return $item->html;
    3. }



    If I press 'Get Tweets' again (for second time), the errors disappear, but still no display.

    Hmm, interestingly, when I put a new copy onto the live server (temp domain), it doesn't get past the twitter authentication. At the top of the page I get the message "There was an error".


    Debug shows me:


    Code
    1. Array
    2. (
    3. [type] => 2
    4. [message] => Cannot modify header information - headers already sent by (output started at /home/klssupportuk/public_html/admin/addons/apps/perch_twitter/modes/settings.pre.php:59)
    5. [file] => /home/klssupportuk/public_html/admin/core/inc/top.php
    6. [line] => 17
    7. )

    which is a tad odd......

    Yes, the perch3_twitter_tweets table has all the entries in there, so that's not the issue.


    Ok, so I emptied the table. Went back into Perch and reauthenticated the App, which was fine, then when I go to Tweets and hit 'Get Tweets', I get a number of errors.


    Quote

    Notice: Trying to get property of non-object in C:\KDL-Projects\Open\kdl_kls\www\admin\addons\apps\perch_twitter\PerchTwitter.class.php on line 163

    This error repeats itself a number of times...I presume the amount of tweets it's pulled down.


    Quote

    Warning: Cannot modify header information - headers already sent by (output started at C:\KDL-Projects\Open\kdl_kls\www\admin\addons\apps\perch_twitter\PerchTwitter.class.php:163) in C:\KDL-Projects\Open\kdl_kls\www\admin\core\lib\PerchUtil.class.php on line 1405

    The above, which I presume is die to the previous error and then lastly...


    Quote

    Warning: Cannot modify header information - headers already sent by (output started at C:\KDL-Projects\Open\kdl_kls\www\admin\addons\apps\perch_twitter\PerchTwitter.class.php:163) in C:\KDL-Projects\Open\kdl_kls\www\admin\core\inc\top.php on line 17

    which again, I presume is due to the first one, just having the same item called in a different file.


    So, dealing with my first error, if I look at the file PerchTwitter.class.php we get on line 163:


    Code
    1. if (!isset($item->error)) {
    2. return $item->html; <--- THIS IS LINE 163
    3. }


    I had found this post but no resolution, same problem though - http://forum.grabaperch.com/fo…playing-on-site-home-page


    Just a thought, it's not something as daft as windows using forward slashes rather than backslashes ?


    Grasping at straws here.


    I will upload everything to the proper server (this is currently on XAMPP on windows) to see if it works there. STill, there must be loads of people working on local copies (XAMPP) on a PC.

    It's just really odd, I can 'Get Tweets' and I get the green bar with all tweets updated, no errors. I can go into the perch twitter settings and force re-authentication and it brings me back to the site fine, no errors. The DB has the tweets within it, so I would now presume, the strict bit of Twitter has happened and now it's just an issue with Perch rendering them to the screen.

    My light blue tad has '3' in it, as expected.


    I've already reinstalled the twitter app once and I've even got a new copy (download) in-case there had been some update or corruption on download. I've even tried a different users credentials on Twitter to see if I can display other tweets.


    Really at a loss here, as it all seems ok, but just not rendering the retrieved tweets.

    If I'm correct in thinking, the LIMIT statement would 'limit' the records returned, yet, I can see that the template is called and loops 3times, so I presume this element has nothing to do with it.


    I also presume the tweetIsReply item would be driven via Perch itself to navigate through the tweets and pullback just the required items, i.e. only my tweets, include replies, other peoples tweets etc.


    Ahh, yes, slight apologies. I'm pulling tweets back in multiple pages and I have used different calls to retreive the tweets, thinking it might be something to do with this.

    The above SQL statement was a result from the call:


    PHP
    1. <?php
    2.     perch_twitter_get_latest(array(
    3.     'twitter_id'=>'@KLSSupportUK',
    4. 'type'=>'mine',
    5. 'count'=>1
    6. ));
    7. ?>


    So if I go back to the standard call of:


    PHP
    1. <?php
    2. perch_twitter_get_latest();
    3. perch_twitter_widget_js();
    4. ?>


    My debug becomes:


    SQL
    1. SELECT * FROM perch3_twitter_tweets WHERE tweetType='mine' AND tweetAccount='@KLSSupportUK' ORDER BY tweetDate DESC LIMIT 3


    So again, just the tweetIsReply element missing.


    This does not display any records, but if I add some text to the template, I can see on the page that it has looped through 3 times, so it's finding the 'tweet.html' template, but just not rendering the tweets themselves.


    Any ideas ?


    Thanks, really appreciated.

    My debug returns


    SQL
    1. SELECT * FROM perch3_twitter_tweets WHERE tweetType='mine' AND tweetAccount='@KLSSupportUK' ORDER BY tweetDate DESC LIMIT 1

    So the only difference I can see is the:


    AND tweetIsReply=0


    LIMIT 1 element


    I will look into what these elements are doing or how you can adjust them.

    One other item.


    It seems to make no difference at all if I have the code:

    PHP
    1. <?php perch_twitter_widget_js(); ?>

    on my page. I presume this is just how the tweet is rendered, so if I had my own specific template, this would be obsolete anyway.



    Just grasping at why the template is shown, but the 'tweet' content is not. The only item in my template is


    Code
    1. <perch:twitter id="tweetHTML" encode="true" />

    This displays nothing, but all tweets are in admin etc.

    Hi,


    I'm having an issue with getting the Twitter App working and Tweets displaying on my site.


    I've tried it on a production server as well and no joy, but for the purposes of this thread, I will keep to my development XAMPP set-up (windows).


    I have looked at multiple threads on the forum and some have gotten me further than I was, but cutting a long story short, this morning I decided to cut my losses once more and reinstall the Perch Twitter App. I have entered all the clients details into the Twitter App and (using the advice from http://forum.grabaperch.com/fo…-app-authentication-error) added the extra elements to the Callback URL, which had previously removed some errors.


    However, on initial set-up I received the error:


    Quote

    Notice: Trying to get property of non-object in C:\KDL-Projects\Open\kdl_kls\www\admin\addons\apps\perch_twitter\PerchTwitter.class.php on line 163

    along with some other header issues, which, looking at another thread are caused by the above.


    Once past these errors, all the Tweets were pulled in. If I select 'Get Tweets' again, I get no errors and debug shows me nothing.


    I can Force reauthentication and it comes back to the admin not a problem.


    It's almost as if the Tweets are just not being rendered to the screen.

    In my code, I am just using the standard call:


    PHP
    1. <?php
    2. perch_twitter_get_latest();
    3. perch_twitter_widget_js();
    4. ?>


    Which calls the template tweet.html. I can add content to the template such as:


    Code
    1. <perch:twitter id="tweetHTML" encode="false" />Why does this not display

    and on my page I can see:


    Why does this not displayWhy does this not displayWhy does this not display


    which is what I would expect, with the standard install returning the last three tweets, i.e. cycling through 3 times.


    I've tried a custom call:



    PHP
    1. <?php
    2. perch_twitter_get_latest([
    3. 'twitter_id' => '@KLSSupportUK',
    4. 'type' => 'mine',
    5. 'count' => 3,
    6. 'exclude_replies' => 1,
    7. 'template' => 'twitter/tweet.html',
    8. ]);
    9. ?>


    and still no joy.


    All very odd and highly frustrating. This app used to just work out of the box not a problem but dare I say, ever since Twitter changed their policy, this app just never seems to work correctly for me on local or production servers.


    I've added perchDebug and there is nothing coming up on the output either.


    Below is my diagnostics.


    Any help greatly appreciated, surely cannot be only person having these issues.


    Thanks,


    Andy

    Hi,


    This issue seems to be similar to the thread Search for Blog not building proper URL for result


    I have updated Runway to the latest version and I have created a simple search solution to pull results from across the site, be it a standard template created page, or a page from the blog.


    I have two blogs running, namely 'News' and 'Resources'.


    The issue is that when the search pulls back the results:


    Code
    1. <perch:search id="result_url" />


    any page that has been created from the pages templates, i.e. 'admin/templates/pages'. I get the correct, expected url, eg: http://anticoagulationuk.org/prevention


    but any content that is being created from the blog app has a url returned of the format:


    http://anticoagulationuk.org/2…-the-following-indication


    where the actual page is at:


    http://anticoagulationuk.org/n…is-conference-london-2019


    so it is missing the name of the blog, i.e. news or resources.


    Looking at my Settings for the blog, I currently have:


    Site name: /

    Blog post page path: {blogSlug}/{postSlug}

    Slug format: %Y-%m-%d-{postTitle}


    Now, adding news to the post page path:


    Blog post page path: news{blogSlug}/{postSlug}


    will return the correct url, but as I have multiple blogs, I would imagein I need a path along the lines of:


    Blog post page path: {blog}{blogSlug}/{postSlug}


    where {blog} would resolve the name of the blog that the item belongs too, but obviously this is just pseudo made up code and I cannot see if there is an actual piece of code I can use like this to resolve the name of the blog that the content belongs too ?


    Any ideas ?


    Thanks,


    Andy

    Yes, I definitely do not want to do this, just a client request.

    Since your comment, I have spoken with them and managed to put them off. Yay ! :-)

    Thanks for your reply Clive.

    Hi,


    I'm not sure this is feasible currently, but I have a client that wants to initiate comments on their blog. However, what they would like to do is allow all blog comments to be live immediately and then, if required, mark them as rejected or spam at a later date. In other words, they do not initially have the time / overhead to review each comment as it comes in and go to the CMS to mark it as live etc etc.


    Currently, even though I have turned off 'notify author of new comments', I am wondering if there is a setting I can use to make all initial comments 'live'.


    I know this probably goes against the grain of the whole ethos of a blog and the set-up, but I can understand that (potentially) there will be very few comments that actually will need any other action apart from being set 'live' and as such, if this can be automated, that would save time.


    Thanks,


    Andy

    Hi Drew, just noticed your reply.


    Ok, I found a duplicate of the secret call within the different config files on the live site. I've removed it, so there is only one call and this has removed the error when I do a url call back, however, the url callback does not bring down the latest tweets to Runway (which I presume it should). The CRON job is not updating the tweets on the site either. However, the 'Get Tweets' button in the admin works.


    Moving over to my dev site. I can get tweets manually from the admin 'Get Tweets' button, the CRON job is not updating anything, the url callback fails (to be expected) but if I try to reauthenticate the app on the dev site (I'm running it on XAMPP), I get the error:


    Quote

    There was an error: Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings

    It reauthenticates fine on the live site.


    Really odd.....

    Every 15mins, but I've tried it also at every 5min, every 1min and a few others.

    However, surely the url callback would work, as does this not just force what the cron job would do at the point of submission of the url.


    I've got the hosting company to take a look as well to see if they can see any reason why this maybe happening.


    Thanks.