Custom module migration

Hi

I have created a number of custom modules, fairly simple stuff, no module settings, just code to support a few things on templates.

In our current workflow, whenever we make changes to the Drupal system we will run a `drupal ce` and commit the yml to our repo so other devs can import the config change.

Currently, as far as I can see, this doesnt touch the custom modules I have added and assume Migration API support has to be coded into each module for it to be able to be included.

Drupal 8 - How to make ajax calls from custom block?

I have a custom module that creates a block. This block is a chat that interacts with an external service through an API.

When the user sends a message through the chat, jQuery takes the message and sends it using $.ajax() to submit.php which then does all the handling to get the response from the API and returns in back to jQuery to be displayed to the user.

Now all of this is in theory, since I haven't been able to find a way to get the correct path to that submit.php file.

Image style with one dimension fixed, one automatic

I need a way to create thumbnails with a fixed height, but a variable width. I don't want the image cropped, but resized, maintaining its height/width ratio. Currently it does not seem possible, I have searched around but only found something old pertaining to Drupal 7.

Anyone knows whether there is some kind of module, or a code hack to accomplish this?
Shouldn't be to difficult to accomplish this programatically, in fact, it is curious that it is not possible.

Page title for custom entity is not working

I have a custom entity and I want to show entity title using two concatenated fields.

I have implemented the label method within the definition of my custom entity class:

public function label() {
$obra = $this->get('idobra')->entity;
$ordem_servico_label = format_string('@obra-@sequencial', [
'@obra' => $obra->label(),
'@sequencial' => $this->get('sequencial_obra')->value
]
);
return $ordem_servico_label;
}

migrated drupal 8 now some pages do not load

Hi.

I migrated drupal 8 from my older server to a new server.

I installed drupal 8 on the new server, copied over addon modules, themes, files. then copied over the database.

Then when I loaded the website the home page didn't load correctly just a few lines of textI then refreshed the page and it worked normal. Clicked on one of the links on the front page which should lead to a node and all I am shown is

<code>

Skip to main content

[Site Name]

[Page Title]

</code>

Using GeoPHP in custom Form

Hi Forum,

i want to use the geoPHP library in a custom form, i´ve installed the lib with the geofield. Now i added:

use GeoPHP\GeoPHP;

and in my validateForm:

public function validateForm(array &$form, FormStateInterface $form_state) {
		$geom = \geoPHP::load('MULTILINESTRING((10 10,20 20,10 40))','wkt');
...

but i get the errorm that the  Error: Class 'geoPHP' not found. For which keywords i have to google?

best regards

Andy

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x