WordPress editor stuck in code

The new WordPress editor, Gutenberg, has had a mixed reception. For users that are only occasional editors on a site, it can be a pain to get to grips with, especially as the implementation is still quite buggy.

One of my clients tried to add a post to a site he hadn’t contributed to for some time and ran straight into a difficulty: the visual editor wasn’t working for him at all. His view should have been this:

…but what he got instead was this:

In other words, his interface was stuck in the code editor. Unfortunately, he had no way of changing this (and neither did I as admin) in the UI. We changed a lot of variables, suspecting first his browser choice (Edge) and then OS choice (Windows). Long story short, the fix is to add an entry into the user’s meta table setting the rich_editing variable true.

INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '999', 'rich_editing', 'true')

What do you want to know about…?

There’s often a difference of opinion about engaging children in science (or indeed, any topic) by asking them what they’d like to know. I have a view on this based upon reflection on explicit use of things like KWL grids and other “what do you want to find out about” approaches. This view is that the stimulus or experience that is used to engage learners should generate questions for them: something much more subtle than “what do you want to know about blast furnaces?”. for example. It is hard to ask meaningful questions about something you have little knowledge or experience of. A good teacher will give the learners enough enculturation into a new topic such that they can ask useful and meaningful questions. This means that the questions aren’t restricted to the start of a topic: explicit use of them is needed throughout the topic, to progress learning but also more closely follow the learners’ interests. I wonder what you think of that.

(from a comment on a student journal)

Catholic Interference in Education

I was asked this week to provide a reference “to testify to [a person’s] religious belief and character”. I refuse to do this, not least because I can’t testify to anyone’s religious anything but also because I am not comfortable encouraging the interference of any church group in education, in particular the Catholic Church, infamous for interfering with children.

The Scottish Catholic Education Service website has this:

The relevant legislation on the management of denominational schools in Scotland states: “A teacher appointed to any post on the staff of any such school by the education authority. . . shall be required to be approved as regards religious belief and character by representatives of the church or denominational body in whose interest the school has been conducted.”

My difficulty with this is that is goes directly against what we are trying to do in education. Indeed, lawyers advise that it is…

unlawful to discriminate against an employee on the basis of age, sex, race, disability, marriage and civil partnership, sexual orientation, gender reassignment, pregnancy and maternity, and religion or belief

It is clear that employers have no right to discriminate on the basis of religion and that if asked, teachers should refuse to provide this information. The anachronism of church interference in education needs to end now.

 

A new photo site

I’ve migrated the photography posts from this site over to a new place. The idea is to separate the photography related posts from the other stuff I post here in my personal blog. You’re welcome to go and take a look, and follow along with new posts if you like.

Find it at https://photo.cullaloe.net.

Rename Image Files in Folders

This is a Python script to walk a directory tree, renaming .jpg and .JPG files. It was written for a client who had a directory containing multiple directories, each containing zero or more (up to 100) image files. Most of the images were named <abitrary name 1>.jpg or <arbitrary name 2>.JPG.
The client wanted each folder’s images to be numbered 001.jpg to nnn.jpg for some further process.

import os
import imghdr

def renamefiles(path):
rootstructure=os.path.abspath(path)
n = 0
for root, dirs, files in os.walk(rootstructure):
for f in files:
if os.getcwd() != root:
n = 0 # Reset the counter
os.chdir(root)

type = imghdr.what(f)
if type == 'jpeg':
n +=1
os.rename(f, str(n).zfill(3) + ".jpg")

# Specify the full path to the directory here.
renamefiles("/Users/myuser/Desktop/TheImageFolder")

Grav Error 403 in Admin Panel

I’m trying out Grav, a flat file CMS, on my server. It looks promising, having just installed it with the admin plugin. It seems that there is a fairly well-known problem with false positives from apache’s mod security web application firewall software, which manifests as an annoying 403 error banner in the admin pages (and the notifications panel not loading).

This is easily fixed by whitelisting mod security rule 350147. In Plesk, mod security rules can be whitelisted in the Server Management | Tools and Settings | Security | Web Application Firewall (ModSecurity) page. Enter the security rule ID (in this case 350147) in the box at the end of the page and click apply.

There is a security risk associated with this and users should assess the risk to their servers before implementing this workaround.

Stari Most

1 in 20 non-professional jumpers die jumping from this bridge. You can try it yourself for €25. It’s a way to cool off.

via 500px https://ift.tt/2uM8wbn