似乎无法设法禁用损坏的D8模块,我现在正在遭受WSOD的困扰,而且似乎无法解决
这个问题.我越来越
PHP error
Uncaught PHP Exception ReflectionException: "Class \Drupal\restui\Controller\RestUIController
does not exist" at /mnt/www/html/xxxxx/docroot/core/lib/Drupal/Core/Entity/EntityResolverManager.php
line 132 request_id="v-210c8b9e-9aaa-11e4-9d97-22000a1f8652"
Run Code Online (Sandbox Code Playgroud)
在我的Acquia Cloud日志中,我真的只是想把它从那里拿出来,但没有骰子.通过修改活动服务yml来删除模块有一个hack,但它没有在本地repo中列出.
这似乎是一个更大问题的一部分 - https://www.drupal.org/node/2225029
但答案很少.有人必须知道,对吧?
我通过自定义模块创建了一个编辑自定义表单(节点的)。在这个表单中,我有一个“管理文件”字段(对于一张图片),我将他的默认值设置为 fid;但是,当我的表单呈现时,“托管文件”字段不显示图像。我不明白为什么:/
我的代码:
$form['project']['image'] = array(
'#type' => 'managed_file',
'#title' => t('Image'),
'#default_value' => 10, //Set 10 for the test, the fid "10" exist, I checked
);
Run Code Online (Sandbox Code Playgroud)
我的表格呈现:
[
]
如您所见,没有加载图像,而 default_value 设置为现有的 fid (10)
当我使用 ajax 提交表单时,触发提交的元素会获得焦点。如果我使用无限滚动并且希望将用户保留在页面底部,我不希望出现这种行为。我该如何解决?
焦点返回到这个元素:
$form['submit'] = [
'#type' => 'submit',
'#value' => $this->t('Search'),
'#attributes' => [
'class' => [
'btn',
'btn-md',
'btn-primary',
'use-ajax-submit'
]
],
'#ajax' => [
'wrapper' => $wrapper,
]
];
Run Code Online (Sandbox Code Playgroud) 我已经构建了一个非常简单的模块来学习如何集成 swiftmailer 模块来发送使用自定义树枝模板的电子邮件。
位于此处的默认 swiftmailer twig 模板的副本:http ://cgit.drupalcode.org/swiftmailer/tree/templates/swiftmailer.html.twig 根据文件本身中包含的说明进行了轻微修改和重命名:
* This template may be overriden by module and/or mail key, using any of the
* following template names:
* - swiftmailer.html.twig: global, used by default.
* - swiftmailer--mymodule.html.twig: only emails sent by the module "mymodule".
* - swiftmailer--mymodule--test.html.twig: only emails by the module
* "mymodule" with key "test".
*
Run Code Online (Sandbox Code Playgroud)
twig文件的名称是swiftmailer--emailtester.html.twig,它位于活动的 themes/mytheme/templates 文件夹中。
当我在emailtester.module 中执行发送电子邮件的调用并遍历 Core 中的 ThemeManager.php、twig.engine.php 和 Render.php 文件中的调用时,模板路径指向/modules /contrib/swiftmailer/templates/swiftmailer.html.twig文件,而不是/themes/mytheme/templates/swiftmailer--emailtester.html.twig …
当用户点击前端的链接时,我想在弹出窗口中显示我的自定义表单,我尝试了很多在网络上显示的解决方案,但对我不起作用.
这是我的代码.
$response = new AjaxResponse();
// Get the modal form using the form builder.
$modal_form = $this->formBuilder->getForm('Drupal\fwsactions\Forms\FwsActionsForm');
$modal_form['#attached']['library'][] = 'core/drupal.dialog.ajax';
// Add an AJAX command to open a modal dialog with the form as the content.
$modal_form = render($modal_form);
$response->addCommand(new OpenModalDialogCommand('My Modal Form', $modal_form, ['width' => '800']));
return $response;
Run Code Online (Sandbox Code Playgroud)
如何通过单击链接打开此表单应该怎么做.
我正在努力解决这个问题:
InvalidArgumentException: The URI '' is invalid.
You must use a valid URI scheme. in Drupal\Core\Url::fromUri()
(line 284 of core/lib/Drupal/Core/Url.php).
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题?
我们正在尝试让所有未使用 Composer 安装的 Drupal 模块在 Composer 中进行管理。
清除 Composer 的缓存后,我们运行以下命令:
./composer require dompdf/dompdf;
Run Code Online (Sandbox Code Playgroud)
这将返回:
./composer.json has been updated
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Can only install one of: phenx/php-svg-lib[v0.2, 0.1].
- Can only install one of: phenx/php-svg-lib[v0.2, 0.1].
- Can only install one of: phenx/php-svg-lib[v0.2, 0.1].
- dompdf/dompdf v0.8.0 requires phenx/php-svg-lib 0.2.* -> satisfiable by phenx/php-svg-lib[v0.2]. …Run Code Online (Sandbox Code Playgroud) 我include在Drupal中创建了一个:
{% include directory ~ '/partials/header.html.twig' %}
但我收到此错误:
Twig_Error_Loader: Template "themes/custom/mytheme/partials/header.html.twig" is not defined (Drupal\Core\Template\Loader\ThemeRegistryLoader: Unable to find template "themes/custom/mytheme/partials/header.html.twig" in the Drupal theme registry.) in "themes/custom/mytheme/page--front.html.twig" at line 1. in Twig_Loader_Chain->getCacheKey() (line 115 of vendor/twig/twig/lib/Twig/Loader/Chain.php).
根据Drupal和Twig文档,我正在以正确的方式进行操作。
我有一个目录partials,一个文件header.html.twig。
我究竟做错了什么?我在El Capitan的MAMP和OSX中运行Drupal。Drupal 8.3.7
如何在Drupal commerce-2.x中的表单alter上从product_id加载variants_id?
drupal-8 ×10
drupal ×4
twig ×2
acquia ×1
ajax ×1
composer-php ×1
dompdf ×1
drupal-forms ×1
focus ×1
forms ×1
jquery ×1
php ×1
swiftmailer ×1
url ×1
url-routing ×1