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
dacaacf4
Commit
dacaacf4
authored
14 years ago
by
Alex Barth
Browse files
Options
Downloads
Patches
Plain Diff
Simplify vocabulary loading, better safeguard missing vocabulary configuration.
parent
2f16b56b
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/FeedsTermProcessor.inc
+2
-19
2 additions, 19 deletions
plugins/FeedsTermProcessor.inc
with
2 additions
and
19 deletions
plugins/FeedsTermProcessor.inc
+
2
−
19
View file @
dacaacf4
...
...
@@ -23,11 +23,6 @@ class FeedsTermProcessor extends FeedsProcessor {
* Implements FeedsProcessor::process().
*/
public
function
process
(
FeedsSource
$source
,
FeedsParserResult
$parser_result
)
{
if
(
empty
(
$this
->
config
[
'vocabulary'
]))
{
throw
new
Exception
(
t
(
'You must define a vocabulary for Taxonomy term processor before importing.'
));
}
// Count number of created and updated nodes.
$created
=
$updated
=
$no_name
=
0
;
...
...
@@ -223,24 +218,12 @@ class FeedsTermProcessor extends FeedsProcessor {
* Return vocabulary to map to.
*/
public
function
vocabulary
()
{
// Legacy handling for old feeds importers.
if
(
is_numeric
(
$this
->
config
[
'vocabulary'
]))
{
$vocabularies
=
taxonomy_get_vocabularies
();
return
isset
(
$vocabularies
[
$this
->
config
[
'vocabulary'
]])
?
$vocabularies
[
$this
->
config
[
'vocabulary'
]]
:
NULL
;
}
else
{
if
(
isset
(
$this
->
config
[
'vocabulary'
]))
{
if
(
$vocabulary
=
taxonomy_vocabulary_machine_name_load
(
$this
->
config
[
'vocabulary'
]))
{
return
$vocabulary
;
}
else
{
$vocabularies
=
taxonomy_get_vocabularies
();
foreach
(
$vocabularies
as
$vocabulary
)
{
if
(
$vocabulary
->
module
==
$this
->
config
[
'vocabulary'
])
{
return
$vocabulary
;
}
}
}
}
throw
new
Exception
(
t
(
'No vocabulary defined for Taxonomy Term processor.'
));
}
/**
...
...
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