Categories
Dolibarr Open Source Tutorials

Fix: Dolibarr Multi-Currency Module “invalid_access_key” Error on v22

If you’re running Dolibarr v22 and your Multi-Currency Module suddenly stopped syncing exchange rates — throwing an invalid_access_key error from CurrencyLayer — you’re not alone. The fix takes about 30 seconds.

The Problem

CurrencyLayer migrated their API infrastructure to a new domain under APILayer, but Dolibarr v22’s default endpoint URL still points to the old one. The result: your API key is perfectly valid, but the legacy endpoint no longer recognizes it.

Here’s the error you’ll see when testing the connection or when your scheduled CRON job tries to sync rates:

{
  "success": false,
  "error": {
    "code": 101,
    "type": "invalid_access_key",
    "info": "You have not supplied a valid API Access Key. [Technical Support: support@apilayer.com]"
  }
}

This is misleading — your key isn’t actually invalid. It just needs to be sent to the right place.

The Fix

Navigate to Setup → Modules/Applications → Multi-Currency, or go directly to:

/admin/multicurrency.php

Find the API endpoint URL field. It will contain the old default:

https://api.currencylayer.com/live?access_key=__MULTICURRENCY_APP_KEY__&source=__MULTICURRENCY_APP_SOURCE__

Replace it with CurrencyLayer’s current endpoint:

https://api.apilayer.com/currency_data/live?base=__MULTICURRENCY_APP_SOURCE__

Note two changes here:

  1. The domain moved from api.currencylayer.com to api.apilayer.com/currency_data
  2. The source parameter was renamed to base, and the access_key parameter is no longer passed in the URL (it’s handled differently by the new endpoint)

Hit save, then use the manual sync button to confirm rates pull correctly before relying on your CRON job again.

Will This Be Fixed in Future Versions?

I believe this will be addressed in Dolibarr v23, but if you’re running v22.0.x and don’t plan to upgrade immediately, this manual endpoint change gets you back up and running right away.

I originally posted this fix on the Dolibarr international forum — check the thread there for any additional community discussion or updates.

Quick Checklist

  • Go to /admin/multicurrency.php
  • Update the API endpoint URL to the new api.apilayer.com domain
  • Test with the manual sync button
  • Confirm your CRON job runs clean on the next scheduled cycle

That’s it. Thirty seconds and your multi-currency rates are flowing again.

Categories
Quick Tips Wordpress

Motopress Widget Won’t Insert into Page Content

While working on a recent customer project, I hit a roadblock using the Motopress WordPress plugin. I couldn’t get the widget, Getwid block, or shortcode to dump anything into the content section of my page. The solution was simple, though not obvious without reading their docs.

I tried a few different things, including posting a ticket to Motopress support.

In the end, the solution was simple and two-fold.

A little bit of a suggestion first: use the Gutenberg/Getwid block, as it has a sidebar interface and is simple to use. Otherwise, use the shortcode [mphb_availability_calendar] – though the shortcode requires a few additional parameters to do anything!

See the example below for an example that outputs a 2 month calendar, of availability for the Accommodation Type ID 123:

[mphb_availability_calendar id="123" monthstoshow="2"].

Step 1:

You must include an Accommodation Type ID for the Block to display results.

First: Ensure you are referencing the Accommodation Type ID in the options panel, found in the sidebar. The ID corresponds to one of the accomodation types that you have set up in the Motopress Accomodations settings. You can find the ID by opening the specific Accomodation Type and looking in the URL bar to find the ID.

In my case, the ID is 457 as seen in the URL when I open the Accomodation Type to edit it

You can find the ID of your specific Accommodation Type in the URL found in the address bar of your browser while editing that Accommodation Type i.e. 457 as seen in the URL below:

https://your-website-url.com/wp-admin/post.php?post=457&action=edit

Step 2:

This step may or may not be necessary for you. Due to the simplicity of my customers booking arrangements, we needed to check another setting in the backend in order to show availability on the calendar.

Tick this box to enable availability results without a search

Test

If you have added the Accommodation Type ID, and in some cases ticked the Skip Search Results option on, you should see the calendar of availability output on your page.

Further Troubleshooting

If for some reason, it’s still not working – or your calendar is empty, you may need to generate accommodations or complete other steps of Motopress Setup.

Categories
Offtopic Tutorials

Broken Digital Pocket Scale – Troubleshooting and Repair

This is an off-beat post, and has nothing to do with websites or the digital world for that matter. I’ll be going through the steps I used to fix a broken pocket scale that was gifted to me – I get a lot of, “If you can fix, it it’s yours” gifts.

This 50.00g digital scale stopped working for an unknown reason, and the top suggestion for fixing these scales is a re-calibration. Unfortunately, this digital scale could not be calibrated – likely a result of the problems it was already having. After further inspection I realized the scale still accurately measured negative values. At this point the, “if it’s broken and destined for the garbage, I had might as well see how it works.” Was running through the back of my head.

Check the video out for a quick little tutorial and walkthrough of how I got my scale back in mostly working order. Step-by-step below.

  1. Remove the top plate of your scale to gain access to the mounting points of the weight surface.
  2. In my case there were two Phillips screws
  3. Flip the scale and remove the battery cover to reveal the second mount point
  4. Remove that pair of screws and set them aside as well
  5. Under where the weigh platform was, flip the sensor bar
  6. Re-attach all components

The kicker is, now when I lift the weighing platform, it shows me a proper positive number – reversing the fix brings the problems back. Does anyone with more knowledge of digital circuitry have an explanation for this rogue resistor?