CKEditor and paths to plugin scripts - drupal

I was using CKEditor with no problems on my site then moved the site from one directory to another -- /vmgdev to /vmg. Everything is working OK except ckeditor, which doesn't appear. It seems that ckeditor is failing to load the autogrow plugin scripts, as it's still looking at the old path. Disabling autogrow fixes the problem and ckeditor appears again. In the head of a page that uses the editor I still have the following:
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, {
...
"loadPlugins": { "autogrow": { "name": "autogrow", "desc": "Autogrow plugin", "path": "/vmgdev/sites/all/modules/ckeditor/ckeditor/plugins/autogrow/", "default": "f" },
...;
//--><!]]>
</script>
How I can I fix the autogrow plugin path? In the form that allows me to change the ckeditor global profile the plugins path is set to %m/plugins and beneath this field it claims that %m is equal to %m - /vmg/sites/all/modules/ckeditor, but that's obviously not the path that's being used.
Thanks.

Remember to clear the cache on your Drupal server as well as the cache on your browser.
Since ckeditor relies on a lot of javascript, I've found that often the browser caches the javascript and doesn't show the changes you've made even if you've refreshed the Drupal cache.

Related

Next JS Version 12+: Static Site Generation

I'm using Next.js version 12.0.4 on a new project, having used Next.js version 10 on a prior one.
Has something changed with Static Site Rendering at build time? It's rendering all my output pages when I do an npm run build (which in turn executes "next build and next export") with html files that include a ton of .js files and no native text "content" which I'd expect.
That is, the output doesn't have any of the standard HTML <h1>, <h2> etc. in it, just a bunch of javascript for the client to hydrate.
Prior versions of Next.js (or perhaps it was my configuration?) seemed to render pure, finalized HTML just fine.
I'm trying to render a simple About page (no dynamic routes, no dynamic props for this route) and, while it properly renders a page in the "/about/index.html" output location, that page has a bunch of .js files and a JSON payload. That page does indeed display properly, but I'd really like the output in the "out" directory to be actual .html files with HTML pre-rendered, for SEO and other reasons.
In my next.config.js, I've specified:
module.exports = {
exportPathMap: function () {
return {
"/": { page: "/" },
"/about": { page: "/about" },
};
},
};
I've also specified getStaticProps on the about page conponent (about.tsx). (I'm using typescript if that matters.)
The rendered /about/index.html file has a ton of .js includes and no real HTML "content".
Have I missed a configuration setting? What can I do to make it render pure HTML where I'd like?
AHA! Ok, so this error was of course a coding error on my side.
In _app.tsx, I had a wrapper for Authentication that I had written. By (bad) design, it was deliberately NOT rendering children for it if the user wasn't authenticated. Therefore, the pre-renderer wouldn't render the "regular" html elements, because the pre-renderer of course does not sign in.
If this same problem happens to you, make sure you're not wrapping all views up in some provider element which conditionally renders children.

What wordpress plugin generates '<meta http-equiv="imagetoolbar" content="no">' line of code

This line of code appears in the html of my wordpress website.
<meta http-equiv="imagetoolbar" content="no"><!-- disable image toolbar (if any) -->
It is some legacy code relating to images on IE6, and is no longer needed.
It's invalid html, in fact.
I want to remove it, but I cannot find where this line of code was generated.
It does not appear to be in any theme files.
Does anyone know what plugin might have produced that line of code?
In my case the plugin "All In One Wordpress Security" added the code as part of it's "Copy Protection" security setting.
It is located under:
Dashboard -> WP Security -> Miscellaneous -> Copy Protection..
[ ] Check this if you want to disable the "Right Click", "Text Selection" and "Copy" options on the front end of your site.
As pointed out by #sparky It is not necessary to hunt down references to this line of code or remove it from one's website.
In my case I became obsessed in achieving 100% HTML validation.
As #sparky noted in comments to his question "...It's only applicable to IE version 6 and all other browsers will ignore it."
He also updated his answer to indicate that IE8 and IE7 no longer reference it.
While HTML validation notes it as an "Error", in practical use it is not harmful, and does not necessarily need to be removed.
If you do want to remove this code, there are a couple of methods you can use to find where it is being added to your website (assuming WordPress - modify as needed)
search your /wp-content/plugins folder for the term imagetoolbar (suggested by #anmari)
disable plugins one by one (or via divide and conquer), empty all caches (including CDN), View Source (or run validator) ... until the code goes away. Or do the same in reverse: Disable everything, then enable to find the culprit.
On my site there were two plugins that could add that code were:
"CornerStone"
"All In One WP Security & Firewall" (as labeled in the WordPress.org plugins repo),
("All In One WP Security" as listed under your site Plugins, and
"WP Security", as labeled in your Dashboard)
AnMari notes that "gravityforms" and some themes may also use this code.

Meteor: Images and text do not load after moving to Iron:Router

My site works fine when the data is in a template, but once I try to route to it using iron:router, a background image and most remaining content no longer appear. (Some of the content still appears with working css, JS components so I know that those files are being read. Also, when inspecting the element, all the text, images are still visible in the code, but not the website.
This works fine (index.html):
<body>
{{>home}}
</body>
This adds another {{>home}} section, but the new section is having issues rendering as explained above (router.js):
Router.map(function() {
this.route('home', {path: '/'});
});
Are you on the latest iron:router? I had a similar problem, and inquired about it in this pull request:
https://github.com/iron-meteor/iron-router/issues/1051
Latest response indicates this should be fixed now!
You've followed the wrong tutorial :( There are plenty of tutorials and articles out there explaining to define routes like you did.
However, the Iron Router project page explains how to define routes differently.
For more information on routes, have a look at this article about Iron Router as well.
Fixed: problem was not with iron:router but rather that not all elements were loaded into the page yet. Document.ready() works fine when I directly called template.
Issue is that when iron:router loads the template, the new page elements are being loaded after the JS files were already called (JS that animates the images/text in).
Solution: use rendered instead of document ready:
Template.MyTemplate.rendered = function(){
}

How to remove websphere portal UI CSS

We are developing a website using websphere portal 8. Is there a way to prevent the portal to integrate the portal CSS in the mashup files that are being served on a page request? The CSS contains all the lotus ui styles we do not use on that website.
Yes, you can. Portal 8 Theme has different profiles, you should understand profile like 'how many js/css/other portal staff' is loaded on the page. You can say page use light profile. To set profile to page you should open page properties and set property
resourceaggregation.profile=profiles/profile_lightweight.json
But even in that case you'll see portal css that you do not want to see.
All profiles json files located in static part of your theme theme/static/themes/Portal8.0/profiles
By default there are 4 files
profile_admin.json
profile_deffered.json
profile_full.jon
profile_lightweight.json
I suppose you able to create your own profiles.
If you take a closer look at this profiles you'll see what modules this profiles brings to page, for example lightweight profile
"moduleIDs": [
"wp_theme_portal_80",
"wp_portlet_css",
"wp_one_ui",
"wp_one_ui_dijit",
"wp_legacy_layouts",
"wp_client_ext",
"wp_status_bar",
"wp_theme_menus",
"wp_theme_skin_region",
"wp_theme_high_contrast",
"wp_layout_windowstates"
],
In your case you interested with wp_theme_portal_80 - how to know what this module contains?
To know it you should open contributions directory and lookup theme.json file. Open it and you'll see next
"modules":[{
"id":"wp_theme_portal_80",
"prereqs":[{
"id":"wp_client_main"
},{
"id":"wp_client_ext"
}],
"contributions":[{
"type":"head",
"sub-contributions":[{
"type":"js",
"uris":[{
"value":"/js/head.js"
}]
}, {
"type":"css",
"uris":[{
"value":"/css/master.css"
}, {
"value":"/css/masterRTL.css",
"type":"rtl"
}]
}]
}]
},
This files will we included in your html markup if you use lightweight profile. I suppose now it is clear how to avoid portal css on the page - just edit profile json/create own profile/edit theme.json Be careful to broke default portal theme if you'll be modify theme.json or default profiles
Hope it will helpful for you.

Wordpress - Images not showing up in the Media Library

I have a huge problem with my Wordpress. My uploaded images don't list in the Media Library.
It is weird tho, it says I have 75 images, but display none. Take a look yourself.
Even weirder, if I go into gallery (the images you uploaded in the page itself), the images list just fine.
I already tried deactivating all my plugins, didn't work. Cache can be easily put out of the question, because it happened on at least 4 different computers, with Macs, PCs, and navigating with Safari, Firefox and Chrome.
Another interesting fact is that if I upload the image directly trough the computer (with the "From Computer" tab), everything goes fine. Another website on the same server works just fine too. And just to add to the complexity, when I go to the media page in the Wordpress Admin, all images show up just fine.
Oh, and before I forget... applying any filters, or doing a research in the media will always come up with the same problem.
So there... that's where I'm at.
I had a same problem just now, with missing media library images for my blog. The images appeared to be right there in the media library and were definitely on the actual web server (checked via FTP).
As Allen Z advised I did "check Settings → Media and make sure that Uploading Files folder is set to wp-content/uploads"
Mine were set to the default blank. I altered this to an absolute path http://www.example.com/wp-content/uploads
THIS DIDNT SOLVE THE PROBLEM when I refreshed the site in browser. However, I immediately changed the path back to blank (the default setting again) and everything came back! Woop
Everyone having this problem might want to try this before getting into the more technical fixes!
it was your permalinks... you must have changed to labeled-name... switch back to default.
that worked for me.
Check Screen Options (dropdown tab in the upper right hand corner of the page), and make sure there are sane settings for what to show on screen. All the column settings should be checked, and there should be a positive number of media items being shown on screen.
If that is ok, then check Settings → Media and make sure that Uploading Files folder is set to wp-content/uploads.
I believe these are the only settings that can be changed from the administrative screens.
Here's something a guy on Wordpress forum showed us. Add the following to your functions.php file. (remember to create a backup of your functions.php first)
add_filter( 'wp_image_editors', 'change_graphic_lib' );
function change_graphic_lib($array) {
return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
}
...it was that simple.
Well, Seems like there was a bug when creating custom post types in the function.php file of the theme... which bugged that.
I had this problem with wordpress 3.8.1 and it turned out that my functions.php wasn't saved as utf-8. Re-saved it and it
I faced same issue on my wordpress site. After the lot of debugging i fixed my problem step by step like this.
First add given below code your db-config.php
define('SCRIPT_DEBUG', TRUE);
define('WP_DEBUG', TRUE);
define( 'WP_DEBUG_LOG', true );
Then goto /wp-includes/js/wp-util.js files and find the code $.ajax(
options ) on line number 100 insert given below code into your file
deferred.jqXHR = $.ajax( options ).done( function( response ) {
try {
response = JSON.parse(response);
} catch (Exception) {
response = response;
}
Please check your may be resolved.
if you Removed constant from db-config.php
define('SCRIPT_DEBUG', TRUE);
define('WP_DEBUG', TRUE);
define( 'WP_DEBUG_LOG', true );
Then compress your /wp-includes/js/wp-util.js file code and put your compressed code into /wp-includes/js/wp-util.min.js
*change your own risk if your update your wordpress version your changed may be lost.
Did you ever change the directory of your Wordpress install?
I had a problem with not finding my uploaded images after changing the Wordpress location on my server. In Wordpress, I went to Dashboard-> Settings -> Media and changed the uploads folder in the "Store uploads in this folder" field.
Considering the files were not uploaded via media uploader, they are present in the server but there's no reference to them in your database (in a little more detail).
In order to fix it, install the Media Sync plugin. Once it's active, under Media > Media Sync > Scan Files and select the files you want to import by click the checkbox next to them. Make sure also you untick the selectbox Dry Run (test without making database changes).
Then, when the time comes for you to be ready, just click "Import Selected" and you should see something like this
Once it is finished, you can visit Media > Library and you'll see all your imported files there.
How did you upload those images; via FTP or through WP uploader? You have to upload images THROUGH WP uploader in order to show them in the image library.
Ubuntu stores uploads in /var/lib/wordpress/wp-content/uploads . So what you need is to have this directory within your wordpress installation. Something like:
sudo ln -s /var/lib/wordpress/wp-content/uploads /var/www/www.mysite.com/wp-uploads
(replace mysite.com with your domain, the file should exist) should do the trick.
(Note that I've not tested this with multiple wordpress installations on one server.)
Further note that to make upload work at all (but this wasn't the question), you need to change Settings / Media / Store uploads in this folder to
wp-content/uploads
(no leading slash).
check .htaccess file in root of wordpress, maybe there is a rule for /uploads directory.
if so, remove it. but be careful and check which plugin did it, so disable the plugin, first.

Resources