Compare commits
5 Commits
8fbe8021b0
...
f4a5d5d11e
Author | SHA1 | Date |
---|---|---|
Jurij Podgoršek | f4a5d5d11e | |
Jurij Podgoršek | ed19c55ff4 | |
Jurij Podgoršek | 35d445e0fb | |
Lio Novelli | 695d06da33 | |
Jurij Podgoršek | 350256a853 |
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
# Ignore configuration files that may contain sensitive information
|
# Ignore configuration files that may contain sensitive information
|
||||||
/web/sites/*/settings.local.php
|
/web/sites/*/settings.local.php
|
||||||
|
# Ignore ddev settings
|
||||||
|
/web/sites/*/settings.ddev.php
|
||||||
|
|
||||||
# Ignore paths that may contain user-generated content
|
# Ignore paths that may contain user-generated content
|
||||||
/web/sites/*/files
|
/web/sites/*/files
|
||||||
|
|
|
@ -24,6 +24,10 @@ Sajt je dostopen preko naslova: https://yufu-manifest.ddev.site/
|
||||||
|
|
||||||
Lahko pa napišemo tudi `ddev launch`
|
Lahko pa napišemo tudi `ddev launch`
|
||||||
|
|
||||||
|
v `web/sites/default/settings.local.php` dodamo vrstico, ki vključi services nastavitve, ki omogočijo CORS:
|
||||||
|
|
||||||
|
`$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/default/yufu.services.yml';`
|
||||||
|
|
||||||
### Postavitev (vuejs) "prednjegadela"
|
### Postavitev (vuejs) "prednjegadela"
|
||||||
|
|
||||||
Najprej gremo v podfolder `nuxt` in namestimo odvisne javascript pakete:
|
Najprej gremo v podfolder `nuxt` in namestimo odvisne javascript pakete:
|
||||||
|
|
|
@ -130,13 +130,13 @@ function _yufu_admin_concept_drafted_mail(NodeInterface $node) {
|
||||||
if ($node->isNew()) {
|
if ($node->isNew()) {
|
||||||
$params['message'] = t('New concept created: @title - @url', [
|
$params['message'] = t('New concept created: @title - @url', [
|
||||||
'@title' => $node->getTitle(),
|
'@title' => $node->getTitle(),
|
||||||
'@url' => !$node->isNew() ? $node?->toUrl()?->toString() : '',
|
'@url' => '',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$params['message'] = t('New changes to concept proposed: @title - @url', [
|
$params['message'] = t('New changes to concept proposed: @title - @url', [
|
||||||
'@title' => $node->getTitle(),
|
'@title' => $node->getTitle(),
|
||||||
'@url' => !$node->isNew() ? $node?->toUrl()?->toString() : '',
|
'@url' => $node?->toUrl()?->toString(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
$params['node_title'] = $node->getTitle();
|
$params['node_title'] = $node->getTitle();
|
||||||
|
|
|
@ -12,6 +12,7 @@ use Drupal\rest\ResourceResponse;
|
||||||
use Psr\Log\LogLevel;
|
use Psr\Log\LogLevel;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||||
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||||
|
|
||||||
|
@ -125,9 +126,8 @@ class AddConcept extends ResourceBase {
|
||||||
$concept->set('body', $data['text'] ?? $concept->body->value);
|
$concept->set('body', $data['text'] ?? $concept->body->value);
|
||||||
$concept->isDefaultRevision(FALSE);
|
$concept->isDefaultRevision(FALSE);
|
||||||
$concept->setRevisionLogMessage('New revision by concept endpoint.');
|
$concept->setRevisionLogMessage('New revision by concept endpoint.');
|
||||||
$concept->moderation_state->target_id = 'draft';
|
$concept->set('moderation_state', 'draft');
|
||||||
$concept->set('status', 0);
|
$concept->set('status', 0);
|
||||||
$concept->setUnpublished();
|
|
||||||
$concept->save();
|
$concept->save();
|
||||||
$this->logger->notice('New concept @title revision @revid created by uid @uid.', [
|
$this->logger->notice('New concept @title revision @revid created by uid @uid.', [
|
||||||
'@title' => $concept->getTitle(),
|
'@title' => $concept->getTitle(),
|
||||||
|
@ -163,7 +163,8 @@ class AddConcept extends ResourceBase {
|
||||||
'revision_uid' => $concept->getRevisionUserId(),
|
'revision_uid' => $concept->getRevisionUserId(),
|
||||||
'uid' => $concept->uid->target_id,
|
'uid' => $concept->uid->target_id,
|
||||||
];
|
];
|
||||||
$response = new ResourceResponse($response_status);
|
// $response = new ResourceResponse($response_status);
|
||||||
|
$response = new JsonResponse($response_status);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,7 +183,8 @@ class AddConcept extends ResourceBase {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
$node_storage = $this->entityTypeManager->getStorage('node');
|
$node_storage = $this->entityTypeManager->getStorage('node');
|
||||||
if ($concept = end($node_storage->loadByProperties(['uuid' => $uuid]))) {
|
$concepts = $node_storage->loadByProperties(['uuid' => $uuid]);
|
||||||
|
if ($concept = end($concepts)) {
|
||||||
return $concept;
|
return $concept;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -1,50 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
$host = "db";
|
|
||||||
$port = 3306;
|
|
||||||
$driver = "mysql";
|
|
||||||
|
|
||||||
// If DDEV_PHP_VERSION is not set but IS_DDEV_PROJECT *is*, it means we're running (drush) on the host,
|
|
||||||
// so use the host-side bind port on docker IP
|
|
||||||
if (empty(getenv('DDEV_PHP_VERSION') && getenv('IS_DDEV_PROJECT') == 'true')) {
|
|
||||||
$host = "127.0.0.1";
|
|
||||||
$port = 32786;
|
|
||||||
}
|
|
||||||
|
|
||||||
$databases['default']['default'] = array(
|
|
||||||
'database' => "db",
|
|
||||||
'username' => "db",
|
|
||||||
'password' => "db",
|
|
||||||
'host' => $host,
|
|
||||||
'driver' => $driver,
|
|
||||||
'port' => $port,
|
|
||||||
'prefix' => "",
|
|
||||||
);
|
|
||||||
|
|
||||||
$settings['hash_salt'] = 'kShGqBypYstnMBJYmaRocqYLQcvBTMgvGbLQkdODVMavjRUyDhgBFcSAideqnFoM';
|
|
||||||
|
|
||||||
// This will prevent Drupal from setting read-only permissions on sites/default.
|
|
||||||
$settings['skip_permissions_hardening'] = TRUE;
|
|
||||||
|
|
||||||
// This will ensure the site can only be accessed through the intended host
|
|
||||||
// names. Additional host patterns can be added for custom configurations.
|
|
||||||
$settings['trusted_host_patterns'] = ['.*'];
|
|
||||||
|
|
||||||
// Don't use Symfony's APCLoader. ddev includes APCu; Composer's APCu loader has
|
|
||||||
// better performance.
|
|
||||||
$settings['class_loader_auto_detect'] = FALSE;
|
|
||||||
|
|
||||||
// Set $settings['config_sync_directory'] if not set in settings.php.
|
|
||||||
if (empty($settings['config_sync_directory'])) {
|
|
||||||
$settings['config_sync_directory'] = 'sites/default/files/sync';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Override drupal/symfony_mailer default config to use Mailhog
|
|
||||||
$config['symfony_mailer.mailer_transport.sendmail']['plugin'] = 'smtp';
|
|
||||||
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['user']='';
|
|
||||||
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['pass']='';
|
|
||||||
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['host']='localhost';
|
|
||||||
$config['symfony_mailer.mailer_transport.sendmail']['configuration']['port']='1025';
|
|
||||||
|
|
||||||
// Development services (for CORS)
|
|
||||||
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/yufu.dev.services.yml';
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
services:
|
||||||
|
cors.config:
|
||||||
|
enabled: true
|
||||||
|
|
Loading…
Reference in New Issue