• Resolved strarsis

    (@strarsis)


    When saving/creating a Content Blocker, the following error occurs: Uncaught Error: Class "DevOwl\RealCookieBanner\lite\settings\TcfVendorConfiguration" not found in [...]/plugins/real-cookie-banner/inc/comp/language/Hooks.php:228

    Another symptom is that when trying to save an existing Service (that is used by that Content Blocker by the way, this error occurs): Could not update the meta value of technicalDefinitions in database

    Latest WordPress (6.2.2) and the Real Cookie Banner plugin (3.7.2) are used.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Contributor Matthias Günter

    (@mguenter)

    Hey @strarsis !

    Are you using the PRO version of Real Cookie Banner?

    Thread Starter strarsis

    (@strarsis)

    Hi Matthias,

    This issue occurs in the free version.

    Thread Starter strarsis

    (@strarsis)

    @mguenter: Is there a way to find out why exactly saving the settings fails?
    Are there diagnostics information that I can post here?

    Plugin Contributor Matthias Günter

    (@mguenter)

    Hi @strarsis !

    No, there are no other diagnostics information. If you haven’t set up too much yet, would it be possible to test resetting the plugin under Cookies > Settings > “Reset”?

    Thread Starter strarsis

    (@strarsis)

    @mguenter: I reset everything, but the error re-occurs when saving a new service.

    Thread Starter strarsis

    (@strarsis)

    @mguenter: So I think I found the reason, accidentally 90 years instead of days was set. However, although this may be very rare, it should not cause the save process to crash. I guess the duration is converted to a number (e.g. seconds) and 90 years would result in a number that is too large for the variable/field to hold.

    Edit: I also had to remove and re-add some cookies to make saving the service work again.

    • This reply was modified 1 year, 4 months ago by strarsis.
    Thread Starter strarsis

    (@strarsis)

    @mguenter: After some further investigation it appears clear that indeed the TcfVendorConfiguration class is simply missing from the plugin files.

    I can find class files for the namespace DevOwl\RealCookieBanner\lite\settings, but TcfVendorConfiguration is not among them. I grepped the whole plugin directory, after plugin installation and setup (in case the plugin downloads those files somehow), and nothing came up as a class definition.

    In the aforementioned Hooks.php:

    $postType = $meta_key === Blocker::META_NAME_SERVICES ? Cookie::CPT_NAME : TcfVendorConfiguration::CPT_NAME;

    When $meta_key is something else than the service group, e.g. “Statistics”, the custom post type name is retrieved from the constant CPT_NAME of the TcfVendorConfiguration class. That TcfVendorConfiguration class does not exist in the plugin directory, nor in any files of the whole WordPress site.

    What surprises me is that the TCF feature is used at all in the free variant of the plugin, as TCF is only available in the PRO variant and should always be disabled anyway.

    This is the (redacted) JavaScript equivalent fetch request the client side does:

    fetch("https://example-site.localhost/wp-json/wp/v2/rcb-blocker?_method=POST&_v=3.7.2&_locale=user&_dataLocale=de", {
    "headers": {
    "accept": "application/json, /;q=0.1",
    "accept-language": "de,en;q=0.9,en-US;q=0.8",
    "cache-control": "no-cache",
    "content-type": "application/json;charset=utf-8",
    "pragma": "no-cache",
    "sec-ch-ua": "\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\", \"Google Chrome\";v=\"114\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin",
    "x-wp-nonce": "cc5b2a2ec1"
    },
    "referrer": "https://example-site.localhost/wp/wp-admin/admin.php?page=real-cookie-banner-component",
    "referrerPolicy": "strict-origin-when-cross-origin",
    "body": "{\"title\":\"Test 2\",\"content\":\"Test 2\",\"status\":\"publish\",\"meta\":{\"rules\":\"Test 2\",\"criteria\":\"services\",\"services\":\"5904\",\"isVisual\":false,\"visualMediaThumbnail\":0,\"tcfVendors\":\"\"}}",
    "method": "POST",
    "mode": "cors",
    "credentials": "include"
    });

    When I strip the tcfVendors field from the JSON payload (body), the request works fine and the content blocker is saved correctly (with a service linked to it). The mere presence of that tcfVendors field, even just holding an empty string, causes this issue.

    When those services were saved with an error, they are not listed, but still counted in the Cookie Banner dashboard, they are stored incompletely in the database.

    • This reply was modified 1 year, 4 months ago by strarsis.
    • This reply was modified 1 year, 4 months ago by strarsis.
    • This reply was modified 1 year, 4 months ago by strarsis.
    • This reply was modified 1 year, 4 months ago by strarsis.
    • This reply was modified 1 year, 4 months ago by strarsis.
    • This reply was modified 1 year, 4 months ago by strarsis.
    • This reply was modified 1 year, 4 months ago by strarsis.
    • This reply was modified 1 year, 4 months ago by strarsis.
    • This reply was modified 1 year, 4 months ago by strarsis.
    • This reply was modified 1 year, 4 months ago by strarsis.
    • This reply was modified 1 year, 4 months ago by strarsis.
    • This reply was modified 1 year, 4 months ago by strarsis.
    Plugin Contributor Matthias Günter

    (@mguenter)

    Hey @strarsis !

    Uncaught Error: Class “DevOwl\RealCookieBanner\lite\settings\TcfVendorConfiguration” not found in […]/plugins/real-cookie-banner/inc/comp/language/Hooks.php:228

    Attached, you will find a pre-release of the plugin. This solves the problem you mentioned. You can simply upload this version to your WordPress and replace it with the current version (Plugins > Add new > Upload Plugin; Screenshot). When the next version of the plugin incl. the pre-released feature is available for all users, you will see it as a normal update in your WordPress.

    Download pre-release:?https://storage-dev-1.owlsrv.de/prereleases/b6a0a0d7-db5d-4b30-a3c5-812ffc0f0cb9/real-cookie-banner-3.8.0-5627-plugin.zip

    Could not update the meta value of technicalDefinitions in database

    Unfortunately, I cannot reproduce the issue on my end. Can you please check if you can reproduce the issue on a plain WordPress installation?

    Thread Starter strarsis

    (@strarsis)

    Hi Matthias,

    thanks for the patch! Indeed, after installing the patch, the content blocker can be created/updated without an error.

    The service that previously also failed updating (failed with an error) still failed updating – but creating it anew works fine.

    Concerning the issue with non-listed “zombie” services and content blockers: I will try to create a reproducible example with steps. It appears that on update/creation errors a part of the service or content blocker was not saved in database, it is still listed in the Dashboard, but not in the edit lists.

    • This reply was modified 1 year, 4 months ago by strarsis.
    Plugin Contributor Matthias Günter

    (@mguenter)

    Hi again @strarsis !

    The service that previously also failed updating (failed with an error) still failed updating – but creating it anew works fine.

    Concerning the issue with non-listed “zombie” services and content blockers: I will try to create a reproducible example with steps. It appears that on update/creation errors a part of the service or content blocker was not saved in database, it is still listed in the Dashboard, but not in the edit lists.

    Ok, I will close this ticket for now. Feel free to reopen or respond to it when you have a reproducible example. ??

    Thread Starter strarsis

    (@strarsis)

    @mguenter: When would be the next stable release, that would include this fix?

    Plugin Contributor Matthias Günter

    (@mguenter)

    Hey @strarsis !

    What fix do you mean exactly?

    Thread Starter strarsis

    (@strarsis)

    @mguenter: I mean the pre-release which works without issues. When would it become a new, stable release?

    Plugin Contributor Matthias Günter

    (@mguenter)

    We released it yesterday, v3.8.0. ??

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Error when saving/creating content blocker’ is closed to new replies.