Skip to content

Instantly share code, notes, and snippets.

View gravypower's full-sized avatar
🇦🇺

Aaron Job gravypower

🇦🇺
View GitHub Profile

Keybase proof

I hereby claim:

  • I am gravypower on github.
  • I am gravypower (https://keybase.io/gravypower) on keybase.
  • I have a public key whose fingerprint is 74C3 A2FD 31B0 15E1 74BB 943A 26EA FDC6 7675 C8BE

To claim this, I am signing this object:

@gravypower
gravypower / WorkbenchModerationPublish.php
Created October 6, 2016 22:45
Add an action plugin to transition between states
<?php
namespace Drupal\some_module\Plugin\Action;
use Drupal\Core\Action\ActionBase;
use Drupal\Core\Session\AccountInterface;
/**
* Publishes a node.
*
Recoverable fatal error: Argument 1 passed to Drupal\Console\Command\Command::__construct() must be an instance of Symfony\Component\Console\Helper\HelperSet, none given in /home/aaron/Projects/Pantheon/greaterbendigo/vendor/drupal/console/src/Command/Command.php on line 35
Recoverable fatal error: Argument 1 passed to Drupal\Console\Command\Command::__construct() must be an instance of Symfony\Component\Console\Helper\HelperSet, none given in Drupal\Console\Command\Command->__construct() (line 35 of /home/aaron/Projects/Pantheon/greaterbendigo/vendor/drupal/console/src/Command/Command.php).
The website encountered an unexpected error. Please try again later.
Drupal\Core\Entity\EntityStorageException: Cannot set a list with a non-array value. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 757 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal\Core\TypedData\TypedDataManager->create(Object, 'some@email.com')
Drupal\Core\Plugin\Context\Context->setContextValue('some@email.com')
Drupal\Core\Plugin\Context\Context->__construct(Object, 'some@email.com')
Drupal\Core\Plugin\Context\Context::createFromContext(Object, 'some@email.com')
Drupal\rules\Plugin\RulesExpression\RulesAction->mapContext(Object, Object)
Drupal\rules\Plugin\RulesExpression\RulesAction->executeWithState(Object)
Drupal\rules\Plugin\RulesExpression\ActionSet->executeWithState(Object)
@gravypower
gravypower / name
Created January 28, 2016 23:58
nginx server configuration example
server {
server_name <name>;
root /var/www/<name>r; ## <-- Your only path reference.
# Enable compression, this will help if you have for instance advagg module
# by serving Gzip versions of the files.
gzip_static on;
location = /favicon.ico {
namespace Patterns.AbstractFactory.People
{
using Patterns.AbstractFactory.Drinks;
/// <summary>
/// The aaron.
/// </summary>
public class Aaron : ICocktailFactory
{
/// <summary>
protected override void OnDocumentWriting(DocumentWritingEventArgs docArgs)
{
var currentNode = _nodeFactoryFacade.GetNode(docArgs.NodeId);
var categories = currentNode.GetProperty("categories").Value;
if (!string.IsNullOrEmpty(categories))
{
var categoryNodeIdsXml = XElement.Parse(categories);
var categoryNodeIds = categoryNodeIdsXml.Descendants("nodeId");
foreach (var categoryNodeId in categoryNodeIds)
var fields = typeof(BaseUmbracoIndexer).GetFields(BindingFlags.NonPublic | BindingFlags.Static);
var disableInitializationCheckField = fields.SingleOrDefault(x => x.Name == "DisableInitializationCheck");
if (disableInitializationCheckField == null)
{
Assert.Fail("Could Not Set DisableInitializationCheck");
}
disableInitializationCheckField.SetValue(null, true);
using NUnit.Framework;
using Gravyframe.Kernel.Umbraco.Tests.Examine;
using NSubstitute;
namespace Gravyframe.Data.Umbraco.Tests
{
[TestFixture]
public class ExampleExamineTests
{
private MockedIndex mockedIndex;