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
edb23846
Commit
edb23846
authored
10 years ago
by
Chris Leppanen
Browse files
Options
Downloads
Patches
Plain Diff
Issue #2305919 by twistor: Fixed Return 404 when trying to edit a non-existent feed.
parent
7600c42d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
feeds.module
+16
-8
16 additions, 8 deletions
feeds.module
feeds.pages.inc
+8
-10
8 additions, 10 deletions
feeds.pages.inc
feeds_ui/feeds_ui.admin.inc
+5
-2
5 additions, 2 deletions
feeds_ui/feeds_ui.admin.inc
with
29 additions
and
20 deletions
feeds.module
+
16
−
8
View file @
edb23846
...
...
@@ -281,7 +281,7 @@ function feeds_menu() {
'access callback'
=>
'feeds_page_access'
,
'file'
=>
'feeds.pages.inc'
,
);
$items
[
'import/%'
]
=
array
(
$items
[
'import/%
feeds_importer
'
]
=
array
(
'title callback'
=>
'feeds_importer_title'
,
'title arguments'
=>
array
(
1
),
'page callback'
=>
'drupal_get_form'
,
...
...
@@ -290,12 +290,12 @@ function feeds_menu() {
'access arguments'
=>
array
(
'import'
,
1
),
'file'
=>
'feeds.pages.inc'
,
);
$items
[
'import/%/import'
]
=
array
(
$items
[
'import/%
feeds_importer
/import'
]
=
array
(
'title'
=>
'Import'
,
'type'
=>
MENU_DEFAULT_LOCAL_TASK
,
'weight'
=>
-
10
,
);
$items
[
'import/%/delete-items'
]
=
array
(
$items
[
'import/%
feeds_importer
/delete-items'
]
=
array
(
'title'
=>
'Delete items'
,
'page callback'
=>
'drupal_get_form'
,
'page arguments'
=>
array
(
'feeds_delete_tab_form'
,
1
),
...
...
@@ -304,7 +304,7 @@ function feeds_menu() {
'file'
=>
'feeds.pages.inc'
,
'type'
=>
MENU_LOCAL_TASK
,
);
$items
[
'import/%/unlock'
]
=
array
(
$items
[
'import/%
feeds_importer
/unlock'
]
=
array
(
'title'
=>
'Unlock'
,
'page callback'
=>
'drupal_get_form'
,
'page arguments'
=>
array
(
'feeds_unlock_tab_form'
,
1
),
...
...
@@ -313,7 +313,7 @@ function feeds_menu() {
'file'
=>
'feeds.pages.inc'
,
'type'
=>
MENU_LOCAL_TASK
,
);
$items
[
'import/%/template'
]
=
array
(
$items
[
'import/%
feeds_importer
/template'
]
=
array
(
'page callback'
=>
'feeds_importer_template'
,
'page arguments'
=>
array
(
1
),
'access callback'
=>
'feeds_access'
,
...
...
@@ -377,14 +377,18 @@ function feeds_admin_paths() {
* Menu loader callback.
*/
function
feeds_importer_load
(
$id
)
{
return
feeds_importer
(
$id
);
try
{
return
feeds_importer
(
$id
)
->
existing
();
}
catch
(
FeedsNotExistingException
$e
)
{
return
FALSE
;
}
}
/**
* Title callback.
*/
function
feeds_importer_title
(
$id
)
{
$importer
=
feeds_importer
(
$id
);
function
feeds_importer_title
(
FeedsImporter
$importer
)
{
return
$importer
->
config
[
'name'
];
}
...
...
@@ -426,9 +430,13 @@ function feeds_access($action, $param) {
return
FALSE
;
}
$importer_id
=
FALSE
;
if
(
is_string
(
$param
))
{
$importer_id
=
$param
;
}
elseif
(
$param
instanceof
FeedsImporter
)
{
$importer_id
=
$param
->
id
;
}
elseif
(
$param
->
type
)
{
$importer_id
=
feeds_get_importer_id
(
$param
->
type
);
}
...
...
This diff is collapsed.
Click to expand it.
feeds.pages.inc
+
8
−
10
View file @
edb23846
...
...
@@ -63,11 +63,10 @@ function feeds_page() {
/**
* Render a feeds import form on import/[config] pages.
*/
function
feeds_import_form
(
$form
,
&
$form_state
,
$importer
_id
)
{
$source
=
feeds_source
(
$importer
_id
,
empty
(
$form
[
'nid'
][
'#value'
])
?
0
:
$form
[
'nid'
][
'#value'
]
);
function
feeds_import_form
(
array
$form
,
array
&
$form_state
,
FeedsImporter
$importer
)
{
$source
=
feeds_source
(
$importer
->
id
);
$form
=
array
();
$form
[
'#importer_id'
]
=
$importer_id
;
$form
[
'#importer_id'
]
=
$importer
->
id
;
// @todo Move this into fetcher?
$form
[
'#attributes'
][
'enctype'
]
=
'multipart/form-data'
;
$form
[
'source_status'
]
=
array
(
...
...
@@ -169,9 +168,9 @@ function feeds_import_tab_form_submit($form, &$form_state) {
* Used on both node pages and configuration pages.
* Therefore $node may be missing.
*/
function
feeds_delete_tab_form
(
$form
,
&
$form_state
,
$importer
_id
,
$node
=
NULL
)
{
function
feeds_delete_tab_form
(
array
$form
,
array
&
$form_state
,
FeedsImporter
$importer
=
NULL
,
$node
=
NULL
)
{
if
(
empty
(
$node
))
{
$source
=
feeds_source
(
$importer
_
id
);
$source
=
feeds_source
(
$importer
->
id
);
$form
[
'#redirect'
]
=
'import/'
.
$source
->
id
;
}
else
{
...
...
@@ -213,9 +212,9 @@ function feeds_delete_tab_form_submit($form, &$form_state) {
* Used on both node pages and configuration pages.
* Therefore $node may be missing.
*/
function
feeds_unlock_tab_form
(
$form
,
&
$form_state
,
$importer
_id
,
$node
=
NULL
)
{
function
feeds_unlock_tab_form
(
$form
,
&
$form_state
,
FeedsImporter
$importer
=
NULL
,
$node
=
NULL
)
{
if
(
empty
(
$node
))
{
$source
=
feeds_source
(
$importer
_
id
);
$source
=
feeds_source
(
$importer
->
id
);
$form
[
'#redirect'
]
=
'import/'
.
$source
->
id
;
}
else
{
...
...
@@ -284,8 +283,7 @@ function feeds_fetcher_callback($importer, $feed_nid = 0) {
/**
* Template generation
*/
function
feeds_importer_template
(
$importer_id
)
{
$importer
=
feeds_importer
(
$importer_id
);
function
feeds_importer_template
(
FeedsImporter
$importer
)
{
if
(
$importer
->
parser
instanceof
FeedsCSVParser
)
{
return
$importer
->
parser
->
getTemplate
();
}
...
...
This diff is collapsed.
Click to expand it.
feeds_ui/feeds_ui.admin.inc
+
5
−
2
View file @
edb23846
...
...
@@ -273,10 +273,10 @@ function feeds_ui_export_form($form, &$form_state, $importer) {
/**
* Edit feed configuration.
*/
function
feeds_ui_edit_page
(
$importer
,
$active
=
'help'
,
$plugin_key
=
''
)
{
function
feeds_ui_edit_page
(
FeedsImporter
$importer
,
$active
=
'help'
,
$plugin_key
=
''
)
{
// Get plugins and configuration.
$plugins
=
FeedsPlugin
::
all
();
$config
=
$importer
->
config
;
// Base path for changing the active container.
$path
=
'admin/structure/feeds/'
.
$importer
->
id
;
...
...
@@ -291,12 +291,14 @@ function feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '') {
$active_container
[
'body'
]
=
'<div class="help feeds-admin-ui">'
.
feeds_ui_edit_help
()
.
'</div>'
;
unset
(
$active_container
[
'actions'
]);
break
;
case
'fetcher'
:
case
'parser'
:
case
'processor'
:
$active_container
[
'title'
]
=
t
(
'Select a !plugin_type'
,
array
(
'!plugin_type'
=>
$active
));
$active_container
[
'body'
]
=
drupal_get_form
(
'feeds_ui_plugin_form'
,
$importer
,
$active
);
break
;
case
'settings'
:
drupal_add_js
(
drupal_get_path
(
'module'
,
'ctools'
)
.
'/js/dependent.js'
);
ctools_include
(
'dependent'
);
...
...
@@ -311,6 +313,7 @@ function feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '') {
$active_container
[
'body'
]
=
feeds_get_form
(
$plugin
,
'configForm'
);
}
break
;
case
'mapping'
:
$active_container
[
'title'
]
=
t
(
'Mapping for !processor'
,
array
(
'!processor'
=>
$plugins
[
$config
[
'processor'
][
'plugin_key'
]][
'name'
]));
$active_container
[
'body'
]
=
drupal_get_form
(
'feeds_ui_mapping_form'
,
$importer
);
...
...
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