Sometimes you may have 2 different modules implementing hook_form_alter() on the same form. In that case, the order of the module execution would follow the alphabetic order of the module name. If you want to alter the execution order, you could either update the system table in database or install the Modules Weight module.
1. Download and install the Modules Weight.
2. Go to admin/config/system/modules-weight to adjust the module weight.
After enabling the Cache blocks option @ admin/config/development/performance, the form inside a custom block throws the following error.
- The form has become outdated. Copy any unsaved work in the form below and then reload this page.
One work around is to disable cache for that specific custom block and this could be done by adding the DRUPAL_NO_CACHE in your hook_block_info().
In the previous posts, we have gone through some examples about working with Drupal 8 RESTful web service.
We can also add node to Drupal through web service. But as i mentioned before, the RESTful feature is not fully completed so we can only create a node with a title. Here is a example web service client in PHP using Guzzle.
1. Get your PHP client ready by following my previous post.
2. Update your index.php as follow.
$cookiePlugin = new CookiePlugin(new ArrayCookieJar());
$client = new Client('http://drupal8.localhost.com');
$request = $client->post('user', null, array(
'name' => '<username>',
'pass' => '<password>',
'form_id' => 'user_login_form',
$response = $request->send()->json();
Previously I have setup a a Drupal 8 which is RESTful ready.
Guzzle is a PHP HTTP client & framework for building RESTful web service clients. In this example, we would create a simple .php to fetch a node from Drupal 8.
1. Make sure you have the Composer installed. You can refer to my previous post.
After studying Drupal 8 for a few days, i got the feeling that there are still a lot of works to polish it before a beta or RC release. And lacking documentation is another big problem to kick start with Drupal 8. This post may help you to get some simple idea on how to setup RESTful service in Drupal 8 but very likely, the details will change in the future.
1. Enable the RESTful Web Services.
It’s time to get start with Drupal 8! The biggest change in this major update is that Drupal 8 is now with the Symfony PHP framework. So Drupal developer could work with those components such as ClassLoader, Routing and DependencyInjection which are provided by the Symfony framework.
Ok! Stop talking and start coding~ =D
The following example is a simplified version from the screencast recorded by Joe Shindelar @ Drupalize.Me.
General Assembly Hong Kong and I will be giving a Drupal Workshop on 14th August 2013 at the Hive. Make your reservation at the GA website.
Drupal is an open source Content Management System (CMS) and in this 2 hours workshop, we will go through the basic concepts on working with Drupal including Content Type, Node, Block, Module and Theme.
This class is a stepping stone for you to get into the Drupal world. Whether you are web developer, an entrepenuer or a project manager, by understanding the Drupal habitat, you will be able to consider whether Drupal is fit for your career, your business or your project.
Hope to see you there~ =)
21st Floor, The Phoenix Building
No.23 Luard Road
A client website recently has moved to a new server and the Drupal PHPMailer module failed to authenticate the Gmail account. You could try the following steps to allow other application to access your account.
1. Go to https://accounts.google.com/DisplayUnlockCaptcha and click Continue.
I have never tried to build a Drupal application with paid membership. Both Ubercart and Drupal Commerce provide membership subscription feature. This example is a proof of concept on implementing paid membership on Ubercart.
1. Enable the Roles module in Ubercart.