Categories
CMS Development Drupal

How to delete all revisions of gievn content type except the latest one?

I am having a very large website which have around 4 lakh nodes of story content type. And these nodes have around 20 lakh revisions. How can i delete all the revisions except the latest one so i can reduce the size of my database. I have tried node node revison delete module with no […]

Categories
CMS Development Joomla

Joomla Contact Custom Fields Not Saving

Joomla 3.9.13 I have a number of Joomla contacts with custom fields setup (mostly text only) When I open a contact in the back end, make some changes and click save, the page reloads and the field values are cleared. Any idea why this might be happening? I have a look at my database and […]

Categories
CMS Development Drupal Website

How to redirect the user to an external website with POST data?

I want to implement an offsite payment method and everything is going well except the fact that I can’t find how to redirect the user to the offsite payment gateway after submitting the cart checkout review When the user submits the checkout review, the orderSubmit function is called. Inside this function I create the array […]

Categories
CMS Development Drupal

How can I add a field to a field group programmaticall in Drupal 8?

I have tried this code but it is not working $form[‘field_test’] = [ ‘#title’ => t(‘test’), ‘#type’ => ‘radios’, ‘#options’ => [t(‘A’), t(‘B’), t(‘C’)], ]; $form[‘#group_children’][‘field_test’] = ‘group_1’; I also tried with $form[‘#fieldgroups’][‘group_1’]->children[] = ‘field_test’; But nothing is working. It works in Drupal 7. Is it changed in Drupal 8? I have written this code […]

Categories
CMS Development Drupal

How to customize the comments?

how to personalize my comments ? I want to display since when the comment was created instead of the date. I want to display the comment ID with the link “permalink”. Can you help me ? Thank you comment–field-article-commentaire.html.twig : <article> <div class=”row card rounded-lg mt-4″> <div class=”card-header p-2 m-0 h6″> <div class=”media”> <div class=”timeline-icon […]

Categories
CMS Development Drupal GitHub

File migration with local path

I would like to create a file migration (example) that uses a local path to an image that I store inside a folder. If I try to enter the path to the image I get ‘not a valid URL’.

Categories
CMS Development Drupal

How to programmatically render a webform to display specific Elements

I have tried this way but not able to hide “confirmation_id” element. public function buildForm(array $form, FormStateInterface $form_state, $sid = NULL) { $my_webform_machinename = ‘request_form’; $my_form = \Drupal\webform\Entity\Webform::load($my_webform_machinename); $my_form[‘elements’][‘flexbox_layout’][‘confirmation_id’][‘#access’] = FALSE; return [ ‘form’ => [ ‘#type’ => ‘webform’, ‘#webform’ => $my_form, ‘#sid’ => $sid, ], ]; }

Categories
CMS Development Joomla

Getting error message as The most recent request was denied because it had an invalid security token. Please refresh the page and try again

In my list view I have added token in my form using <?php echo JHtml::_( ‘form.token’ ); ?> Then I have redirected from the list view to a controller’s task like http://some/joomla/site/administrator/index2.php?option=com_users&task=edit&id=1 In the controller I checked for the token using Session::checkToken() or jexit(Text::_(‘JINVALID_TOKEN’)); Now when I login through backend as Super User select any […]

Categories
CMS Development Joomla

Joomla White Screen After Migration

Joomla 3.9.13 I migrated from a localhost environment to my live server and I’m getting and I’m seeing a white screen, but only for one page and it’s sub-pages. example.com/page1 < working example.com/page2 < not working example.com/page3 < working The page that isn’t working is a menu type > SP Simple Portfolio ยป items. I […]

Categories
CMS Development Drupal HTML

Print title in commerce-product.html.twig

I try to create a custom product template commerce-product.html.twig. The changes work well except except the title. https://docs.drupalcommerce.org/commerce2/developer-guide/products/displaying-products/theme-product says to use but nothing displays for this field. I try but it doesn’t works so. What’s wrong ?