craftcms / apple-news Goto Github PK
View Code? Open in Web Editor NEWPublish your Craft CMS content with Apple News Format.
Home Page: https://craftcms.com/apple-news
License: MIT License
Publish your Craft CMS content with Apple News Format.
Home Page: https://craftcms.com/apple-news
License: MIT License
When saving / updating articles, we routinely run into the following error:
Array
(
[code] => 28
[message] => Operation timed out after 30000 milliseconds with 0 bytes received
[response] =>
)
in /app/vendor/chapter-three/apple-news-api/src/PublisherAPI/Base.php on line 197
When this issue occurs, often times the article is created on the Apple News side - but none of the meta data makes it back into Craft - creating 'disconnected' Apple News entries. We address this by manually pulling the meta data from apple news and updating the database.
I concede that this could be from our content (which tends to be long / rich), or our article class implementation. But maybe others see this issue as well?
It would be great if we could configure the timeout for the connection, (adding say another option in the config files) to allow for a longer timeout for publishers like us.
Will this get updated for Craft 3?
Craft supports some emoji
If add an allowed emoji to an entry (e.g. 👍
in the source view of a Redactor field, to render ๐
), save the entry, and then try to edit the entry, I get
Array
(
[code] => 400
[message] => HTTP/1.1 400 Bad Request
[response] => stdClass Object
(
[errors] => Array
(
[0] => stdClass Object
(
[code] => NOT_ALLOWED
)
)
)
)
in </path/to>/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Base.php on line 197
</path/to>/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Base.php(289)
277 /**
278 * Error handler.
279 *
280 * @param (string) $message Error message to display.
281 * @param (const) $message_type Predefined Constants
282 *
283 * @see http://php.net/manual/en/errorfunc.constants.php
284 */
285 public function triggerError($message, $message_type = E_USER_NOTICE) {
286 $debug_backtrace = debug_backtrace();
287 $trace = $debug_backtrace[0];
288 trigger_error($message . ' in ' . $trace['file'] . ' on line ' .
289 $trace['line'], $message_type);
290 }
291
292 }
Guessing this is a plugin bug, sending an unexpected character to chapter-three's apple-new-api?
Iโm building a site that uses the Apple News plugin, and for some reason when I try to delete an entry Iโm running into an error (see attached screenshot). It appears that this error is related to the Apple News plugin, because when I disable the plugin I can delete entries without issue. This error occurs both when I try to delete an entry in the CMS, as well as when I try to delete an entry via php in a module.
When I download a News Preview where images use asset transforms, images are no longer generated.
Without a transform, images are generated and display at the original size.
I've tried our normal S3 setup and a local file structure and have the same issue with both.
I'm currently getting a failed task showing PHP error code 400 in the stack trace below. Currently on v1.0.2. Any ideas on how best to troubleshoot this?
2018/01/11 19:29:02 [error] [php] Array
(
[code] => 400
[message] => HTTP/1.1 400 Bad Request
[response] => stdClass Object
(
[errors] => Array
(
[0] => stdClass Object
(
[code] => INVALID_DOCUMENT
[keyPath] => Array
(
[0] => components
[1] => 3
[2] => text
)
[message] => "text" was null should be not (null or an empty string)
)
)
)
)
in /storage/av04810/www/app/releases/1515524613/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Base.php on line 197 (/storage/av04810/www/app/releases/1515524613/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Base.php:289)
Stack trace:
#0 /storage/av04810/www/app/releases/1515524613/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Base.php(197): ChapterThree\AppleNewsAPI\PublisherAPI->triggerError()
#1 /storage/av04810/www/app/releases/1515524613/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Curl.php(104): ChapterThree\AppleNewsAPI\PublisherAPI->onErrorResponse()
#2 /storage/av04810/www/app/releases/1515524613/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Curl.php(88): ChapterThree\AppleNewsAPI\PublisherAPI->response()
#3 /storage/av04810/www/app/releases/1515524613/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Curl.php(242): ChapterThree\AppleNewsAPI\PublisherAPI->request()
#4 /storage/av04810/www/app/releases/1515524613/craft/plugins/applenews/services/AppleNews_ApiService.php(153): ChapterThree\AppleNewsAPI\PublisherAPI->post()
#5 /storage/av04810/www/app/releases/1515524613/craft/plugins/applenews/services/AppleNews_ApiService.php(89): Craft\AppleNews_ApiService->post()
#6 /storage/av04810/www/app/releases/1515524613/craft/plugins/applenews/services/AppleNewsService.php(341): Craft\AppleNews_ApiService->createArticle()
#7 /storage/av04810/www/app/releases/1515524613/craft/plugins/applenews/tasks/AppleNews_PostQueuedArticlesTask.php(91): Craft\AppleNewsService->postArticle()
#8 /storage/av04810/www/app/releases/1515524613/craft/app/services/TasksService.php(239): Craft\AppleNews_PostQueuedArticlesTask->runStep()
#9 /storage/av04810/www/app/releases/1515524613/craft/app/services/TasksService.php(200): Craft\TasksService->runTask()
#10 /storage/av04810/www/app/releases/1515524613/craft/app/controllers/TasksController.php(89): Craft\TasksService->runPendingTasks()
#11 /storage/av04810/www/app/releases/1515524613/craft/app/framework/web/actions/CInlineAction.php(49): Craft\TasksController->actionRerunTask()
#12 /storage/av04810/www/app/releases/1515524613/craft/app/framework/web/CController.php(308): CInlineAction->runWithParams()
#13 /storage/av04810/www/app/releases/1515524613/craft/app/framework/web/CController.php(286): Craft\TasksController->runAction()
#14 /storage/av04810/www/app/releases/1515524613/craft/app/framework/web/CController.php(265): Craft\TasksController->runActionWithFilters()
#15 /storage/av04810/www/app/releases/1515524613/craft/app/framework/web/CWebApplication.php(282): Craft\TasksController->run()
#16 /storage/av04810/www/app/releases/1515524613/craft/app/etc/web/WebApp.php(823): Craft\WebApp->runController()
#17 /storage/av04810/www/app/releases/1515524613/craft/app/etc/web/WebApp.php(287): Craft\WebApp->_processActionRequest()
#18 /storage/av04810/www/app/releases/1515524613/craft/app/framework/base/CApplication.php(185): Craft\WebApp->processRequest()
#19 /storage/av04810/www/app/releases/1515524613/craft/app/index.php(62): Craft\WebApp->run()
#20 /storage/av04810/www/app/releases/1515524613/public/index.php(14): require_once()
REQUEST_URI=/index.php?p=admin/actions/tasks/rerunTask
2018/01/11 19:29:02 [error] [application] Encountered an error running task 139 (AppleNews_PostQueuedArticles), step 1 of 2: Array
(
[code] => 400
[message] => HTTP/1.1 400 Bad Request
[response] => stdClass Object
(
[errors] => Array
(
[0] => stdClass Object
(
[code] => INVALID_DOCUMENT
[keyPath] => Array
(
[0] => components
[1] => 3
[2] => text
)
[message] => "text" was null should be not (null or an empty string)
)
)
)
)
in /storage/av04810/www/app/releases/1515524613/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Base.php on line 197 on line 289 of /storage/av04810/www/app/releases/1515524613/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Base.php
I'm unable to publish articles to Apple News. My API keys and secret are correct, as I am able to view correctly-named sections set within News Publisher in the CP. I'm not able to see the Apple News pane on the right side of entries while editing, but the option to publish is visible in the gear menu on the entries index. However, this option is available for all entries, not just the ones specified in the channel class.
I'm using the included example templates, MyNewsArticle.php
and MyNewsChannel.php
, both tailored to fit my section/entry handles and news entry matrix structure where necessary.
Maybe relevant: when I follow the link from inside the plugin, I get a {"errors":[{"code":"UNAUTHORIZED"}]}
response.
If you delete an article in new publisher and try to republish from craft an error is thrown and the publish queue becomes blocked.
The only way to resolve this is the remove the article from the craft_applenews_articles table.
Similar issue to this bug #11 however my error is a return type error (see screenshot)
The deleteArticle method is expecting a return type of stdClass but I actually get an empty string. Following the chain of methods
` public function deleteArticle(string $channelId, string $articleId): stdClass
{
return $this->delete($channelId, '/articles/{article_id}', [
'article_id' => $articleId,
]);
}
calls
/**
* Sends a DELETE request to the Apple News API.
*
* @param string $channelId
* @param string $path
* @param array $pathArgs
* @param array $data
* @return mixed
*/
protected function delete(string $channelId, string $path, array $pathArgs = [], array $data = [])
{
return $this->api($channelId)->delete($path, $pathArgs, $data);
}
which instantiates publisherAPI which then calls
/**
We haven't changed anything on our end so this is a little strange. Unless the news api has changed their responses.
I'm getting the following error in the logs because all Apple News tasks are failing.
Any ideas what could be causing this? I can download the content from the articles in the task and preview it in the News Preview app (Just to double check there were no errors with the way the article was formatted)
2017/11/22 10:14:47 [error] [application] Encountered an error running task 63856 (AppleNews_PostQueuedArticles), step 1 of 4: Array
(
[code] => 404
[message] => HTTP/1.1 404 Not Found
[response] => stdClass Object
(
[errors] => Array
(
[0] => stdClass Object
(
[code] => NOT_FOUND
[keyPath] => Array
(
[0] => articleId
)
[value] => 206516d9-4401-4b23-8338-5e5e8cf637fa
)
)
)
)
in /home/website/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Base.php on line 197 on line 289 of /home/website/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Base.php
https://github.com/craftcms/apple-news#autoloading-your-channel-classes
"applenewschannels\\": "config/apple-news/channels/"
should be
"applenewschannels\\": "config/apple-news-channels/"
I have a plugin to generate a YouTube/Vimeo video URL based on the web URL of the video, and I am trying to access it inside MyNewsArticle.php
.
$videoUrl = craft()->videoEmbed->getEmbedUrl($block->videoUrl);
I got the error Call to undefined function craft()
and noticed that this file isn't using the Craft namespace. What is the best way for me to access other plugins' services?
Typed static property craft\applenews\Helper::$_htmlConverter must not be accessed before initialization
Trying to commit the plugin to git via SourceTree, I get the error:
And indeed, the php-curl-class
has the following bad symlink in it:
vagrant@homestead /htdocs/nystudio107/craft/plugins/applenews/vendor/php-curl-class/php-curl-class/examples (master) $ pwd
/htdocs/nystudio107/craft/plugins/applenews/vendor/php-curl-class/php-curl-class/examples
vagrant@homestead /htdocs/nystudio107/craft/plugins/applenews/vendor/php-curl-class/php-curl-class/examples (master) $ ls -al | grep vendor
lrwxrwxrwx 1 501 dialout 9 Dec 30 06:33 vendor -> ../vendor
vagrant@homestead /htdocs/nystudio107/craft/plugins/applenews/vendor/php-curl-class/php-curl-class/examples (master) $
Minor, but I figured I'd note it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.