mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Improve error message when attempting to fork an unforkable component.
Fixes #5142 and rainlab/forum-plugin#141
This commit is contained in:
parent
869625aef2
commit
c84c51c820
@ -403,6 +403,11 @@ class Index extends Controller
|
||||
$manager = ComponentManager::instance();
|
||||
$componentObj = $manager->makeComponent($componentName);
|
||||
$partial = ComponentPartial::load($componentObj, 'default');
|
||||
|
||||
if (!$partial) {
|
||||
throw new ApplicationException(Lang::get('cms::lang.component.no_default_partial'));
|
||||
}
|
||||
|
||||
$content = $partial->getContent();
|
||||
$content = str_replace('__SELF__', $alias, $content);
|
||||
|
||||
|
@ -249,6 +249,7 @@ return [
|
||||
'invalid_request' => 'The template cannot be saved because of invalid component data.',
|
||||
'no_records' => 'No components found',
|
||||
'not_found' => "The component ':name' is not found.",
|
||||
'no_default_partial' => "This component does not have a 'default' partial",
|
||||
'method_not_found' => "The component ':name' does not contain a method ':method'.",
|
||||
'soft_component' => 'Soft Component',
|
||||
'soft_component_description' => 'This component is missing but optional.',
|
||||
|
Loading…
x
Reference in New Issue
Block a user