Categories
CMS Drupal Mastering Development

Multiple Gutenberg blocks in a module

I’ve created a custom Gutenberg block and would like to know how to add more within the same module. Some suggested to add JS in MY_CustomModule.libraries.yml, but it does not work. My custom H2 heading block in index.es6.js. This simple block is working fine. const { blocks, data, element, components, editor } = wp; const […]

Categories
CMS Mastering Development Wordpress

How to use JQUERY POST AJAX with Classes in wordpress?

I have a [hook] that I use with the permalink /test/ in my test environment that I want to pull certain data. This is placed in a plugin I am developing. Here is an example of what I am doing: www.website.com/test/?step=9 I would like it when you press the button <a href="#ajaxthing" class="myajax" data-id="600"> that […]

Categories
Mastering Development

ik looks like inside foreach my code goes into if and else statement in each loop

I am making a request to my db when I get event of the last 7 days. Then I’d like to check if for some days of this last week, I did not had entries so I can but a good array of data with ‘ ‘ if no input and the correct data if […]

Categories
CMS Mastering Development Wordpress

“WordPress database error: You have an error in your SQL syntax” when using array_filter();

I try to update WP database custom table with form data and everything is OK. BUT one error doesn’t give me peace of mind. WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘WHERE location = […]

Categories
Mastering Development

AWS Cognito-AWS SDK File Upload to S3 Bucket throgh : Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1

I am using aws-sdk for file upload to s3 bucket using aws-cognito facing this error. CredentialsError: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1 I have also attached snapshot of my error to get more clear about the issue. Here is my code for file upload. @Injectable() export class UploadFileService { constructor() {} async […]

Categories
Mastering Development

BST (Binary Search Tree) reverse level-order traversal isn’t giving me the correct answer/result

I really need your help with this exercise about binary search tree. I have to reverse the order of traversal from down to up and from left to right along the way. This is the exercise: Given a BST, write a function that will return a list of values. Elements at the last depth of […]

Categories
Mastering Development

How to write a Python async serial async reader?

I am porting some C++ code to Python and I am having a heck of a time figuring out how to have an onReceive handler for serial bytes. I am using import serial_asyncio class Arduino: #comms is with an Arduino in serial mode) async def connect(self, serial_port): (self.serial_reader, self.serial_writer) = await serial_asyncio.open_serial_connection(url=serial_port, baudrate=115200) print("serial opened:", […]

Categories
Mastering Development

Add percentage symbol to gauge indictor in plotly.js

I have a gauge from plotly.js, which currently looks like this: I need to add the percentage symbol to the number (96 in this example). Trying to achieve this: My current data and layout are: var data = [{ domain: { x: [0, 1], y: [0, 1] }, value: 96, title: { text: "my title" […]

Categories
Mastering Development

How to mock .measure in jest?

I am trying to test my component. In my component, there is a function to measure from the reference of View. when I debug, the ref value exists. but the measure method is undefined. This is the screenshot of the testing. I need help how to mock the .measure or other function from the component […]

Categories
Mastering Development

Can’t generate an error response when user is not verifying recaptcha

everything is working perfectly but for some reason i can’t generate a error response when the user is not checking the ReCaptcha button. the form wont send until the user is checking that he is not a robot. I built a controller for the recaptcha that works perfectly fine and the error msg that it […]