Today I had to create a grid of cards for a search page. To ensure a consistent layout I wanted the excerpt texts to be cut off, if necessary, at certain length.
If you use WordPress and have WPML with their Advanced Custom Fields Multilingual (ACFML) plugin installed you may have already spotted the following option below repeater fields:
While this may seem like a nice option it’s turned on by default and not great for websites that use a repeater as the main content field and have pages with varying content for different languages. I often use the Flynt theme for developing custom-made WordPress sites, which uses the given setup.
The solution: disable the “Synchronise translations” option by default
Sadly I haven’t found a documented way to disable the option. While looking through the ACFML plugin however I’ve found the following solution in two easy steps:
1. Add the following lines to your wp-config.php file:
/* Disable ACFML's sync of repeater field positions across languages by default */
define( 'ACFML_REPEATER_SYNC_DEFAULT', false );
2. Most likely: update setting of existing posts
In your database select the “wp_options” table and look for a record with “option_name” = acfml_synchronise_repeater_fields. This record seems to contain the post IDs of existing posts with their corresponding boolean setting.
Rename the acfml_synchronise_repeater_fields column to something like acfml_synchronise_repeater_fields_backup in order to disable/unset the value for all existing posts. As soon as you set the setting for a post again this record will be recreated.
Feedback appreciated
If this solution helped solve the same problem for you it would be great if you could let me know that in the comments below.
For autoplay to work on Mobile Safari with a native HTML video element you need to also set the “playsinline” attribute. Otherwise the video wouldn’t start to play automatically:
<video muted loop autoplay playsinline preload="auto">
<source src="video.mp4" type="video/mp4">
Your browser does not support playing this video.
</video>
The playsinline attribute is actually a standard HTML attribute, I learned today. I did not encounter any problems with autoplay in other browsers besides within Mobile Safari though.
Since the awesome Github Actions were launched I had the issue that I couldn’t commit workflow files to my Github repos using Tower, my favourite Git client.
The error I received was:
[remote rejected] master -> master (refusing to allow an OAuth App to create or update workflow `.github/workflows/cypress-tests.yaml` without `workflow` scope)
So it seemed clear to me what the cause of the problem: Tower didn’t have the workflow permission scope and so the request would be rejected. After talking to Tower support they said that it’s on their todo list but they do not have an ETA for it (for a while now).
As a temporary workaround I used Github Desktop to commit the workflow files. But changing Git clients just for this is a bit annoying.
Using Personal Access Tokens (PAT) to commit Github Action Workflow files today
A friendly Tower support engineer pointed out that to there is a solution for the problem if you use PATs instead of Oauth to connect to Github:
You should be able to work around this by switching your authentication method to Personal Access Token. To do that, simply to go Tower’s Services View (via the cloud icon on the top left, or using the keyboard shortcut Ctrl+Cmd+S). Right-click on your GitHub service account in the left sidebar, and select Edit. Then, select Personal Access Token as your authentication method and enter your PAT.
…and it works perfectly 🎉
How to change your authentication method to PAT
Edit your Github account settings within Tower and change “Authentication” to “Personal Access Token”:
In your Github Developer Settings create a new Personal Access Token that that contains the original scopes which Tower needs. Then make sure to also include the “workflow” scope of course:
Use the displayed Access Token within Tower and everything should work out of the box.