Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feeds
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
feeds
Commits
24c755d9
Commit
24c755d9
authored
14 years ago
by
Alex Barth
Browse files
Options
Downloads
Patches
Plain Diff
#850638: Introduce FeedsSource::preview().
parent
12f870a3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.txt
+1
-0
1 addition, 0 deletions
CHANGELOG.txt
feeds.module
+1
-4
1 addition, 4 deletions
feeds.module
includes/FeedsSource.inc
+15
-0
15 additions, 0 deletions
includes/FeedsSource.inc
with
17 additions
and
4 deletions
CHANGELOG.txt
+
1
−
0
View file @
24c755d9
...
...
@@ -3,6 +3,7 @@
Feeds 6.x 1.X XXXX
------------------
- #850638 alex_b: Introduce FeedsSource::preview().
- #850298 alex_b: ParserCSV: Support batching (only affects library, full parser
level batch support to be added later with #744660).
- Minor cleanup of admin UI language and CSS.
...
...
This diff is collapsed.
Click to expand it.
feeds.module
+
1
−
4
View file @
24c755d9
...
...
@@ -271,10 +271,7 @@ function feeds_nodeapi(&$node, $op, $form) {
if
(
trim
(
$node
->
title
)
==
''
)
{
try
{
$source
->
addConfig
(
$node_feeds
);
// @todo Too many indirections. Clean up.
$batch
=
$source
->
importer
->
fetcher
->
fetch
(
$source
);
$source
->
importer
->
parser
->
parse
(
$batch
,
$source
);
if
(
!
$last_title
=
$batch
->
getTitle
())
{
if
(
!
$last_title
=
$source
->
preview
()
->
getTitle
())
{
throw
new
Exception
();
}
}
...
...
This diff is collapsed.
Click to expand it.
includes/FeedsSource.inc
+
15
−
0
View file @
24c755d9
...
...
@@ -110,6 +110,21 @@ class FeedsSource extends FeedsConfigurable {
$this
->
load
();
}
/**
* Preview = fetch and parse a feed.
*
* @return
* FeedsImportBatch object, fetched and parsed.
*
* @throws
* Throws Exception if an error occurs when fetching or parsing.
*/
public
function
preview
()
{
$batch
=
$this
->
importer
->
fetcher
->
fetch
(
$this
);
$this
->
importer
->
parser
->
parse
(
$batch
,
$this
);
return
$batch
;
}
/**
* Import a feed: execute, fetching, parsing and processing stage.
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment