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
65f03169
Commit
65f03169
authored
13 years ago
by
Frank Febbraro
Browse files
Options
Downloads
Plain Diff
Merge branch '7.x-2.x' of git.drupal.org:project/feeds into 7.x-2.x
parents
256c7de4
314921ef
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/FeedsNodeProcessor.inc
+46
-18
46 additions, 18 deletions
plugins/FeedsNodeProcessor.inc
with
46 additions
and
18 deletions
plugins/FeedsNodeProcessor.inc
+
46
−
18
View file @
65f03169
...
...
@@ -225,27 +225,52 @@ class FeedsNodeProcessor extends FeedsProcessor {
$targets
[
'title'
]
=
array
(
'name'
=>
t
(
'Title'
),
'description'
=>
t
(
'The title of the node.'
),
'optional_unique'
=>
TRUE
,
);
}
$targets
+=
array
(
'nid'
=>
array
(
'name'
=>
t
(
'Node ID'
),
'description'
=>
t
(
'The nid of the node. NOTE: use this feature with care, node ids are usually assigned by Drupal.'
),
'optional_unique'
=>
TRUE
,
),
'uid'
=>
array
(
'name'
=>
t
(
'User ID'
),
'description'
=>
t
(
'The Drupal user ID of the node author.'
),
),
'status'
=>
array
(
'name'
=>
t
(
'Published status'
),
'description'
=>
t
(
'Whether a node is published or not. 1 stands for published, 0 for not published.'
),
),
'created'
=>
array
(
'name'
=>
t
(
'Published date'
),
'description'
=>
t
(
'The UNIX time when a node has been published.'
),
),
$targets
[
'nid'
]
=
array
(
'name'
=>
t
(
'Node ID'
),
'description'
=>
t
(
'The nid of the node. NOTE: use this feature with care, node ids are usually assigned by Drupal.'
),
'optional_unique'
=>
TRUE
,
);
$targets
[
'uid'
]
=
array
(
'name'
=>
t
(
'User ID'
),
'description'
=>
t
(
'The Drupal user ID of the node author.'
),
);
$targets
[
'status'
]
=
array
(
'name'
=>
t
(
'Published status'
),
'description'
=>
t
(
'Whether a node is published or not. 1 stands for published, 0 for not published.'
),
);
$targets
[
'created'
]
=
array
(
'name'
=>
t
(
'Published date'
),
'description'
=>
t
(
'The UNIX time when a node has been published.'
),
);
$targets
[
'promote'
]
=
array
(
'name'
=>
t
(
'Promoted to front page'
),
'description'
=>
t
(
'Boolean value, whether or not node is promoted to front page. (1 = promoted, 0 = not promoted)'
),
);
$targets
[
'sticky'
]
=
array
(
'name'
=>
t
(
'Sticky'
),
'description'
=>
t
(
'Boolean value, whether or not node is sticky at top of lists. (1 = sticky, 0 = not sticky)'
),
);
// Include language field if Locale module is enabled.
if
(
module_exists
(
'locale'
))
{
$targets
[
'language'
]
=
array
(
'name'
=>
t
(
'Language'
),
'description'
=>
t
(
'The two-character language code of the node.'
),
);
}
// Include comment field if Comment module is enabled.
if
(
module_exists
(
'comment'
))
{
$targets
[
'comment'
]
=
array
(
'name'
=>
t
(
'Comments'
),
'description'
=>
t
(
'Whether comments are allowed on this node: 0 = no, 1 = read only, 2 = read/write.'
),
);
}
// If the target content type is a Feed node, expose its source field.
if
(
$id
=
feeds_get_importer_id
(
$this
->
config
[
'content_type'
]))
{
$name
=
feeds_importer
(
$id
)
->
config
[
'name'
];
...
...
@@ -278,6 +303,9 @@ class FeedsNodeProcessor extends FeedsProcessor {
case
'nid'
:
$nid
=
db_query
(
"SELECT nid FROM
{
node
}
WHERE nid = :nid"
,
array
(
':nid'
=>
$value
))
->
fetchField
();
break
;
case
'title'
:
$nid
=
db_query
(
"SELECT nid FROM
{
node
}
WHERE title = :title"
,
array
(
':title'
=>
$value
))
->
fetchField
();
break
;
case
'feeds_source'
:
if
(
$id
=
feeds_get_importer_id
(
$this
->
config
[
'content_type'
]))
{
$nid
=
db_query
(
"SELECT fs.feed_nid FROM
{
node
}
n JOIN
{
feeds_source
}
fs ON n.nid = fs.feed_nid WHERE fs.id = :id AND fs.source = :source"
,
array
(
':id'
=>
$id
,
':source'
=>
$value
))
->
fetchField
();
...
...
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