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
cd8513e3
Commit
cd8513e3
authored
13 years ago
by
elliotttf
Committed by
Dave Reid
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue #870556: Fixed PuSH verifications run before the subscription records have been saved."
parent
4c0e196f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
feeds.module
+42
-0
42 additions, 0 deletions
feeds.module
plugins/FeedsHTTPFetcher.inc
+9
-1
9 additions, 1 deletion
plugins/FeedsHTTPFetcher.inc
with
51 additions
and
1 deletion
feeds.module
+
42
−
0
View file @
cd8513e3
...
...
@@ -395,6 +395,15 @@ function feeds_page_access() {
* Implements hook_exit().
*/
function
feeds_exit
()
{
// Process any pending PuSH subscriptions.
$jobs
=
feeds_get_subscription_jobs
();
foreach
(
$jobs
as
$job
)
{
if
(
!
isset
(
$job
[
'fetcher'
])
||
!
isset
(
$job
[
'source'
]))
{
continue
;
}
$job
[
'fetcher'
]
->
subscribe
(
$job
[
'source'
]);
}
if
(
drupal_static
(
'feeds_log_error'
,
FALSE
))
{
watchdog
(
'feeds'
,
'Feeds reported errors, visit the Feeds log for details.'
,
array
(),
WATCHDOG_ERROR
,
'admin/reports/dblog/feeds'
);
}
...
...
@@ -1006,3 +1015,36 @@ function feeds_valid_url($url, $absolute = FALSE) {
return
(
bool
)
preg_match
(
"/^(?:[\w#!:\.\?\+=&@$'~*,;\/\(\)\[\]\-]|%[0-9a-f]
{
2
}
)+$/i"
,
$url
);
}
}
/**
* Registers a feed subscription job for execution on feeds_exit().
*
* @param array $job
* Information about a new job to queue; or if set to NULL (default), leaves
* the current queued jobs unchanged.
*
* @return
* An array of subscribe jobs to process.
*
* @see feeds_exit()
* @see feeds_get_subscription_jobs()
*/
function
feeds_set_subscription_job
(
array
$job
=
NULL
)
{
$jobs
=
&
drupal_static
(
__FUNCTION__
,
array
());
if
(
isset
(
$job
))
{
$jobs
[]
=
$job
;
}
return
$jobs
;
}
/**
* Returns the list of queued jobs to be run.
*
* @return
* An array of subscribe jobs to process.
*
* @see feeds_set_subscription_job()
*/
function
feeds_get_subscription_jobs
()
{
return
feeds_set_subscription_job
();
}
This diff is collapsed.
Click to expand it.
plugins/FeedsHTTPFetcher.inc
+
9
−
1
View file @
cd8513e3
...
...
@@ -164,7 +164,15 @@ class FeedsHTTPFetcher extends FeedsFetcher {
*/
public
function
sourceSave
(
FeedsSource
$source
)
{
if
(
$this
->
config
[
'use_pubsubhubbub'
])
{
$this
->
subscribe
(
$source
);
// If this is a feeds node we want to delay the subscription to
// feeds_exit() to avoid transaction race conditions.
if
(
$source
->
feed_nid
)
{
$job
=
array
(
'fetcher'
=>
$this
,
'source'
=>
$source
);
feeds_set_subscription_job
(
$job
);
}
else
{
$this
->
subscribe
(
$source
);
}
}
}
...
...
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