Categories
CMS Drupal Mastering Development

hook_menu_local_tasks_alter is not invoked during functional tests

I have an implementation of hook_menu_local_tasks_alter in my module, which works fine on my dev environment, but when I try to run my module using BrowserTestBase the hook is not invoked when visiting a node. Why? Here is a mock instance of the hook that I’ve set up just to see if the hook is […]

Categories
Mastering Development

Python requests 401 Unauthorized

I’m trying to log in to a cloudflare server based website. I bypassed the login issues using cloudserver, but my next stop point has been when I tried to send a get request to have access to some post login tokens. My code: headers = { ‘authority’: ‘www.paf.es’, ‘accept’: ‘application/json, text/plain, */*’, ‘user-agent’: ‘Mozilla/5.0 (Windows […]

Categories
CMS Development Wordpress

get_edit_post_link() not working on wp-cron

I have a “real” cron job that executes wp-cron.php every now or then. I collect the link in to a variable by $link = get_edit_post_link(ID); It works flawlessly if I am logged in and execute cron manually with wp-cron.php but when it is executed by schedule it wont collect the link and leaves it empty. […]

Categories
Development

‘Set-Cookie’ is not included in the response headers

I’m trying to get the set-cookie header from the http response, but it’s not showing up for most of the requests. Using https://www.southwest.com/ as an example, you can see that https://bs.serving-sys.com/Serving/ActivityServer.bs?cn=as&ActivityID=1345510&rnd=459203.51759912557&fare%20class=[fare%20class]&business%20or%20leisure=[business%20or%20leisure]&number%20of%20passengers=[number%20of%20passengers]&date=[date]&destination=[destination]&origination=[origination] sets 3 cookies: Puppeteer code: const puppeteer = require(‘puppeteer’); async function getResponseCookies() { function handleResponse(response) { const url = response.url(); const headers = response.headers(); […]

Categories
Development HTTP

Get SVG from http GET method and display it

I’m trying to display a SVG image in my webapp but I don’t own the SVG as a file “image.svg”, I call my service and it responds with a http response. The response is as below : “headers”: { “access-control-allow-methods”: [ “PUT” ], “content-length”: [ “249664” ], “x-powered-by”: [ “Express” ], “content-disposition”: [ “attachment; filename=out.svg” […]

Categories
Development

Dataflow job failed after more than 6 hours with “The worker lost contact with the service”?

I am using Dataflow to read data from BigQuery and then do NLP preprocessing using python. I am using Python 3 and SDK 2.16.0. I am using 100 workers (provite IP, private access and Cloud NAT) with workers in europe-west6 and endpoint in europe-west1. The BigQuery tables are in US. Test jobs were working without […]