Categories
Mastering Development

Spring QueryDsl pagination filter by ACL permissions

Let’s assume the following Spring JPA based repository with QueryDsl support. @Repository public interface TeamRepository extends JpaRepository<Team, Long>, QuerydslPredicateExecutor<Team> { } The application uses Access Control Lists (ACL) in service layer for checking permission for individual resources using @PreAuthorize(hasPermission(#id, ‘Team’, ‘READ’) for example. I want to allow a user to request all teams for which […]

Categories
CMS Mastering Development Wordpress

.widget CSS not working on my website

I am very new to website development. Currently, I’m having trouble making CSS changes to a certain class=”widget”. I want this CSS to work. The CSS is on my main.css file: .widget { list-style-type:none; padding:0; margin:0; } This is part of my functions.php file: // Load Stylesheets function load_css() { wp_register_style(‘bootstrap’, get_template_directory_uri() . ‘/css/bootstrap.min.css’, array(), […]

Categories
CMS Mastering Development Wordpress

(BAD REQUEST) 400 admin-ajax.php error WordPress

I updated my WordPress to current version as it was very outdated. And now I am getting a bad request browse issue now. /wp-admin/admin-ajax.php:1 Failed to load resource: the server responded with a status of 400 (Bad Request) browser pop up. This only occurs when user is not logged in admin. I checked plugins and […]

Categories
CMS Drupal Mastering Development

Check-boxes do not render on form after update to drupal core 8.8.0,shows warning for count() function? [closed]

After updating to drupal core 8.8.0 and php 7.2 Checkboxes are not rendering and throws below error. Checkboxes are not rendering on many forms which display list of checkboxes. I updated to latest drupal version 8.8.4 still same warning I am getting and checkboxes are not rendering. Error in retrieving lists. Warning: count(): Parameter must […]

Categories
CMS Mastering Development Wordpress

Bootstrap Menu Toggle not workin

I created a menu using Bootstrap, when I try it statically in a static html page it works without problems, but when I try in a wordpress-theme page it doesn’t work. I tried with Navwalker, but the problem it’s not here because the menu doesn’t work also if not dinamic. When I click the toggle […]

Categories
CMS Development Drupal

Check-boxes do not render on form after update to drupal core 8.8.0,shows warning for count() function?

We have Exact Target(marketing cloud) module customize. It dislays newsletter form with check boxes to select. after updating to drupal core 8.8.0 and php 7.2 Checkboxes are not rendering and throws below error. Error in retrieving lists. Warning: count(): Parameter must be an array or an object that implements Countable in Drupal\Core\Render\Element\Checkboxes::processCheckboxes() (line 58 of […]

Categories
Mastering Development

Use a global variable or local variable for constants in JavaScript?

If I have a simple array constant that I want to use, what is better in terms of performance when using local vs global declaration? // myScript.js const usefulArray = [“say”, “about”, “10”, “array”, “elements”]; export const someFunction = (anotherArray) => { // const usefulArray = [“say”, “about”, “10”, “array”, “elements”]; return anotherArray.concat(usefulArray); } I […]

Categories
CMS Development Magento

Clues on debugging an issue of a plugin

Any tips more than welcome, I have a plugin I created, it’s compatible with latest version of magento but I’m trying to make it compatible with magento 2.16 When activated I can’t go onto homepage nor admin panel I tried this for debuging but it’s not affecting the code: Added on .htaccess file: SetEnv MAGE_IS_DEVELOPER_MODE […]

Categories
CMS Development Wordpress

footer does not respect css stylesheet

I am new in wordpress developing, I try to edit my first blog, editing the menu was not painful, but the footer does not respect the css codes despite the stylesheet is the same. Here is the code where I enqueue the css stylesheet file: function load_stylesheets() { /* loading my own stylesheet */ wp_register_style(‘style’, […]

Categories
Mastering Development

Why is my python list element (subarray) overwritten while being swapped with another?

I’m writing a short script to determine the average number of permutations necessary for an element chosen at random from a 3×7 matrix to move to the “center” (1,3) position as depicted below: import numpy as np import random as rand cards = np.arange(1,22) choice = rand.choice(cards) print choice block = np.split(cards, 3) print block […]