Skip to content
Snippets Groups Projects
Commit 3fa9752f authored by megachriz's avatar megachriz Committed by Chris Leppanen
Browse files

Issue #2175525 by MegaChriz | Max2505: Added User admin is not authorized to create content type.

parent 01e5d17b
No related branches found
No related tags found
No related merge requests found
......@@ -97,13 +97,15 @@ class FeedsEntityProcessor extends FeedsProcessor {
}
if (!$access) {
$message = 'User %name is not authorized to %op entity %entity.';
$args = array(
$message = t('The user %name is not authorized to %op entity %entity_type. To import this item, the user "@name" (owner of the item) must be given the permission to @op entity @entity_type.', array(
'%name' => $author->name,
'%op' => $op,
'%entity' => $this->entityType(),
);
throw new FeedsAccessException(t($message, $args));
'%entity_type' => $this->entityType(),
'@name' => $author->name,
'@op' => $op,
'@entity_type' => $this->entityType(),
));
throw new FeedsAccessException($message);
}
}
}
......
......@@ -104,8 +104,15 @@ class FeedsNodeProcessor extends FeedsProcessor {
}
if (!$access) {
$message = 'User %name is not authorized to %op content type %content_type.';
throw new FeedsAccessException(t($message, array('%name' => $author->name, '%op' => $op, '%content_type' => $entity->type)));
$message = t('The user %name is not authorized to %op content of type %content_type. To import this item, either the user "@name" (author of the item) must be given the permission to @op content of type @content_type, or the option "Authorize" on the Node processor settings must be turned off.', array(
'%name' => $author->name,
'%op' => $op,
'%content_type' => $entity->type,
'@name' => $author->name,
'@op' => $op,
'@content_type' => $entity->type,
));
throw new FeedsAccessException($message);
}
}
}
......
......@@ -437,7 +437,7 @@ class FeedsRSStoNodesTest extends FeedsWebTestCase {
$nid = $this->createFeedNode();
$this->assertText('Failed importing 10 nodes.');
$this->assertText('User ' . $account->name . ' is not authorized to create content type article.');
$this->assertText('The user ' . $account->name . ' is not authorized to create content of type article.');
$node_count = db_query("SELECT COUNT(*) FROM {node}")->fetchField();
// We should have 1 node, the feed node.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment