I'm trying to use the memcachec plugin to read data from the memcached, but when I'm using this config:
<Plugin "memcachec">
<Page "plugin_instance">
Key "KEY1"
Server "localhost"
...
</Page>
</Plugin>
I'm getting memcachec plugin: Option 'server' not allowed here., if I remove the server option I get memcachec plugin: 'Server' missing in 'Page' block.. I've checked the sources of memcachec and there's this code (memcachec.c, line 329):
if (strcasecmp ("Server", child->key) == 0)
status = cmc_config_add_string ("Server", &page->server, child);
if (strcasecmp ("Key", child->key) == 0)
status = cmc_config_add_string ("Key", &page->key, child);
else if (strcasecmp ("Match", child->key) == 0)
/* Be liberal with failing matches => don't set `status'. */
cmc_config_add_match (page, child);
else
{
WARNING ("memcachec plugin: Option `%s' not allowed here.", child->key);
status = -1;
}
It seems like the second if should have been else if for the plugin to work. Is this a bug? Where do I report it? What's the proper way to fix it locally until the official fix arrives?
I guess you got your answer a long time ago, but it seems this has been fixed. Reporting bugs is best done using either the mailing list (see tag info), or opening an issue on github (https://github.com/collectd/collectd).
Related
I'm trying to add social media icons to my drupal website and followed this guide to try and install them. The module seems to install fine, however when I try to configure it to add different links on clicking save it brings me to a webpage that simply says The website encountered an unexpected error. Please try again later.
I've tried uninstalling/reinstalling the plugin and that didn't seem to do anything. Are there some permissions I'm missing in my set up? I'm pretty much brand new to drupal
Edit: The url of the error is admin/structure/block/manage/socialmedialinks?destination=/node
and some of the error log:
TypeError: Argument 2 passed to Egulias\EmailValidator\EmailValidator::isValid() must implement interface Egulias\EmailValidator\Validation\EmailValidation, bool given,
It seems the social_media_links drupal module version 8.x-2.6 has a bug when it checks the validity of email addresses.
There is an issue in the module's issue queue for it HERE.
There is a patch attached to the issue (attached below):
diff --git a/src/Plugin/SocialMediaLinks/Platform/Email.php b/src/Plugin/SocialMediaLinks/Platform/Email.php
index 007e59f..2926d47 100755
--- a/src/Plugin/SocialMediaLinks/Platform/Email.php
+++ b/src/Plugin/SocialMediaLinks/Platform/Email.php
## -4,7 +4,6 ## namespace Drupal\social_media_links\Plugin\SocialMediaLinks\Platform;
use Drupal\social_media_links\PlatformBase;
use Drupal\Core\Form\FormStateInterface;
-use Egulias\EmailValidator\EmailValidator;
use Drupal\Core\Url;
/**
## -29,9 +28,9 ## class Email extends PlatformBase {
*/
public static function validateValue(array &$element, FormStateInterface $form_state, array $form) {
if (!empty($element['#value'])) {
- $validator = new EmailValidator();
+ $validator = \Drupal::service('email.validator');
- if (!$validator->isValid($element['#value'], TRUE)) {
+ if (!$validator->isValid($element['#value'])) {
$form_state->setError($element, t('The entered email address is not valid.'));
}
}
I am developing onlyoffice plugin, which need to consume data (like reportid, session details that will be used to load data from server) from launching application.
structure of page come out like:
launching page (editor.aspx)
-- iframe 1 to load editor
-- -- ifram 2 to load plugin
Here i want to access data from editor.aspx into iframe 2 (javascript)
I tried using queryString like window.parent.location.search but it only can traverse till iframe 1, but not main aspx page. As i don't have control on what loads in iframe 1 it didn't work.
Also i tried with cookies and localStorage but none worked out.
Please guide..
launching page (editor.aspx) -- iframe 1 to load editor -- -- ifram 2
to load plugin. Here i want to access data from editor.aspx into iframe
2 (javascript)
There is no way to get direct access to the iframe with editor, the only way to work with it is using document server plugins
Actually there is a way... Having spent a LOT of time analysing what is going on... finally found a nice way to exchange configs between the TOP frame and PLUGIN frame with just a few lines of code leveraging the onlyoffice API - without any hacks :)
Editor Config object:
config: {
"width" : "100%",
"height" : "100%",
"type" : "desktop",
"documentType": "text",
"token" : "{{token}}",
"document" : {
"title" : "{{document.name}}",
"url" : "{{downloadUrl}}",
...
events: {
'onReady': <application ready callback>, // deprecated
...
'onInfo': function ( data ) {
if ( data && data.data && data.data.getConfig ) {
docEditor.serviceCommand ( 'getConfig', config.document );
}
}
}
}
var docEditor = new DocsAPI.DocEditor("placeholder", config);
onInfo event will receive the request from your plugin.
Need to check the event data has getConfig attribute.
If it does, send back the config to the plugin.
Within your plugin's index.html add an inline script tag with this content:
// config ref
var config;
// Get ready to receive the response from TOP
window.parent.Common.Gateway.on ( 'internalcommand', ( data ) => {
if ( data.command === 'getConfig' ) {
config = data.data;
}
} );
// Send custom config request to TOP
window.parent.Common.Gateway.sendInfo ( { getConfig: true } );
It subscribes to the internalcommand Gateway events which will be called by TOP, then kick in the communication process by calling the sendInfo command. Because the editor and your plugins (most likely) will be hosted on the same domain, you can access it via the window.parent ref.
This will download the config.document configuration object and store it in the plugins local config variable automatically - when you click on the plugin in the toolbar.
I need to upload .exe file in my wordpress website. I have already added define('ALLOW_UNFILTERED_UPLOADS', true); in my wp-config.php file but still showing the same error. Please help.
Thanks
Thanks for you comment, below code solved my issue,
function enable_extended_upload ( $mime_types =array() ) {
// The MIME types listed here will be allowed in the media library.
// You can add as many MIME types as you want.
$mime_types['exe'] = 'application/exe';
return $mime_types;
}
add_filter('upload_mimes', 'enable_extended_upload');
I encountered the same issue and the current answer no longer works for me.
The following works for me in wordpress 5.7.2 (tested using the basic file uploader):
Create a new .php file in the wp-content/mu-plugins directory, with the following content:
<?php
// specify a high priority so that the filter will run later
// there is a built in filter which will remove the entry for 'exe'
add_filter('upload_mimes', function($mimes) {
// this mimetype has to match exactly what
// finfo_file() will return, see wp_check_filetype_and_ext()
$mimes['exe'] = 'application/x-dosexec';
return $mimes;
}, 10000);
I'm facing a strange problem on Meteor and I can't resolve it :
I'm developping a WebRTC app using Meteor, PeerJS and AdapterJS (which give an WebRTC plugin for unsupported browser like Safari or IE). These two libs are downloaded using NPM : meteor npm install peerjs/adapterjs
So in my view's controller I have :
view.js
//import Peer from 'peerjs'; => same error with "import"
//import AdapterJS from 'adapterjs';
Template.view.onRendered(function(){
AdapterJS = require("adapterjs");
Peer = require("peerjs");
//var peerkey="..."
var peer = new Peer({
key: peerkey, // get a free key at http://peerjs.com/peerserver
debug: 3,
config: {'iceServers': [
{ url: 'stun:stun.l.google.com:19302' },
{ url: 'stun:stun1.l.google.com:19302' },
]}
});
But when I run my controller, I get an exception because "console" is undefined inside peerjs/util.js function when calling the peerjs constructor :
Uncaught TypeError: Cannot read property 'log' of undefined
Strangly, when I only require "peerjs", there is no exeption...
I tried to change the order of require functions but it won't work.
Other variable like "alert", "window.console" work and are defined inside the module but "console" not.. :/
Any suggestion can help ^^
Thanks in advance.
EDIT : If I add a breakpoint on the first line of node_module/peerjs/lib/util.js, I see that the "console" variable is "undefined" inside util.js but .... it is defined inside the caller function (fileEvaluate) !
EDIT2 : I tried something else to check if the code inside adapterjs redefine or change something : I put 'require("adapterjs")' inside a timeout function with a long delay (10 seconds) and .... console is still undefined inside peer module ! But when I comment require("adapterjs"), no error, console is defined ! I think that Meteor do something special before running the controller script depending on require functions...
EDIT3 : Here is a git repo to test the project : gitlab.com
If you display the dev console, you will see exceptions.
I found a solution, although I don't fully understand it myself. It's something to do with the way that Meteor imports modules, and Peerjs runs afoul of that.
Basically I copied node_modules/peerjs/dist/peer.js into the client directory, so that Meteor will load it "as is".
A small change to main.js as follows:
import './main.html';
// I placed peer.js from the node_modules/peerjs/dist/peer.js into the client folder and it works fine
// import {Peer} from 'peerjs';
import {AdapterJS as Adapter} from 'adapterjs';
Template.hello.onCreated(function helloOnCreated() {
// counter starts at 0
window.peer = new Peer({
and it works fine :)
I see in line 860+ of adapter.js that console is being defined (part of the shim) from https://github.com/Temasys/AdapterJS/blob/master/source/adapter.js
// IE 9 is not offering an implementation of console.log until you open a console
if (typeof console !== 'object' || typeof console.log !== 'function') {
/* jshint -W020 */
console = {} || console;
// Implemented based on console specs from MDN
// You may override these functions
console.log = function (arg) {};
console.info = function (arg) {};
console.error = function (arg) {};
This code defines the console if it doesn't find one to it's liking? Does this mean you are using IE9 or some other incompatible browser?
Try pasting this into your console and see what it tells you:
if (typeof console !== 'object' || typeof console.log !== 'function') alert("Console not present, needs to be shimmed?"); else console.log("console is ok");
Presumably the reason you are using adapter.js is for compatibility purposes - this will help you trouble shoot it. Please let me know what you find, as I will be following you down this path :)
I'm trying to port my properly working (in iOS, Android) cordova app to Firefoxos.
The simulator starts properly and its browser can load web pages BUT my app cannot load data from the web.
Looking at console I see the following errors:
"JavaScript error: app://aa2a2c24-a8d6-447d-92da-4f2e9af65661/plugins/org.apache.cordova.network-information/src/firefoxos/NetworkProxy.js, line 33: missing : after property id" simulator-process.js:44
"JavaScript error: app://aa2a2c24-a8d6-447d-92da-4f2e9af65661/cordova.js, line 1120: Module org.apache.cordova.network-information.NetworkProxy does not exist."
Any suggestion? Thanks.
Cordova 3.5.0
Simulator FirfeoxOS 1.3 and FirfeoxOS 1.4
After some research I figured out the issues
1- Despite upgrading cordova to 3.5.0 I must remember that plugins don't get automatically update.
To get the plugin code for firefoxos updated I added again the same plugin, removed the firefoxos platform and reinstalled it again.
At that point the javascript errors were gone
2- Then the ajax call were still not accessible due to permissions. To ensure you can have ajax call you have to put in your manifest.webapp the following code
"type": "privileged",
"permissions": {
"systemXHR": { "description": "Required for AJAX calls in app"}
}
Both "type" and "permissions" are needed
3- Finally you have to ensure the ajax calls use
mozSystem: true
Specifically for jquery, you could put something like the following on top of your js file:
if (device.platform == 'firefoxos') {
$.ajaxPrefilter( function( options ) {
if ( options.firefoxOS ) {
options.xhr = function() {
return new window.XMLHttpRequest( {
mozSystem: true
} );
}
}
} );
$.ajaxSetup( {
firefoxOS: true
} );
}
Now I can properly handle ajax calls.