Conteúdo
Amidst the minor bug fixes released in recent months, we have one last major release for 2024, which brings a feature long requested by users.
What’s new
For those familiar with how WordPress works, transferring the authorship of a post or changing its link should be a simple matter, using an interface like the one aside, but at Tainacan we’ve always kept this hidden. After more and more use cases where items were imported by a certain user and then their “creator” needed to be changed to another user, we thought it was time to expose this functionality in our item form.
To bring in these new options, however, we needed to give our item edit form a makeover, moving a few things around and creating a new section that we’re calling “Publication data” (to reinforce the difference between these fields and metadata). This area will also receive existing options, and may contain:
- The field for changing the Author of the item;
- The field to change the item’s Slug (identifying part of the URL);
- The field to change the item’s Status;
- The field to show comments on the item;
In addition, all the new features are optional, just as “Enable comments” was optional before. So let’s first look at how the collection editing form looks with these new options. By default, none of the options are enabled. This means that the only thing the user will be able to change is the item’s Status.
Here is the item form with the Status option re-positioned to the top right of the form, above the document:
This replaces the dropdown at the bottom of the form, where you could also change statuses by clicking “Finish”. Now this dropdown is a simple “Finish” button that exits the form. If you have strong reasons to keep the statuses where they were before, a variable can be changed via the itemEditionStatusOptionOnFooterDropdown
code, using the tainacan-admin-ui-options
filter.
As soon as more options are enabled on the collection form, however, this area changes. And the Publication Data section appears:
The label “Publication data”, as seen above, can be changed in the collection form. Now we can focus on the new fields…
To change the author of the item, the user can click on the “x” in the authorship field and search for user names. Once a new user has been selected, a warning will be displayed:
This is to make it extra clear that this action is dangerous. If a user, for example, is only allowed to edit items that he himself is the author of, he will no longer be able to edit the item from the moment he clicks “Confirm”. Administrators and Editors in general, of course, can edit the item even if they are not the designated Authors of the item.
As for editing the URL, what we actually have is the option to change the “slug”, which is a sanitized version of the item’s name (without accents, spaces, quotation marks, etc.) that builds the end of its link URL. This change is never immediate, there is a small “loading” that occurs when the user finishes typing. This happens to validate whether the proposed address conflicts with an existing one, since the same link cannot lead to more than one page. If it does, the field itself will insert a “-2”, or “-3”, with a sequence of numbers to differentiate that slug from another already in the database.
Finally, these changes are also reflected on the item page within the admin:
The most important thing to note here is that the “Item page on site” button will no longer be present in the footer of this page, since the link has ended up exactly in the “Slug” field.
Obviously, now that you can edit the authorship of items one by one, you’ll probably miss doing it with several at once… Don’t worry, just select as many items as you want and click on “Bulk edit selected items”. In the modal, you can select the “Authorship” field:
But even more interesting may be the demand to edit various items via the CSV importer. For this, we have some new features in our exporter. When exporting a collection, the special_item_author
and special_item_slug
columns will now be present, allowing you to view and edit these fields. Two important details should be made clear:
special_item_author
brings up the author’s username in the database, i.e. the username that has been generated for logging in. This is a unique field, usually without spaces or special characters, as opposed to a full name or email address;special_item_slug
gives only the slug of the item, not its entire URL. You’ll find this information in the public_url field, which cannot be changed via importer;
With these columns, these two can be changed in your spreadsheet editor. Remember to provide valid author usernames and unique slugs, otherwise you will receive error messages during your import.
Improvements
- Several improvements to the way files are uploaded on import, making it possible to incorporate direct links to Google Drive files;
- Improved detection of files not found in private items;
- Aesthetic improvements to the advanced search modal;
- Better hiding of search control components when disabled in the Faceted Search block;
Bug fixes
- Reports screen was crashing even if few data had to be loaded;
- Compound child metadata errors were not being displayed properly in the item edit form depending on the edit flow;
- Sorting of manually selected items in blocks was inverted;
- Overlapping of items in Masonry and Chips view modes without collapsing the filter panel;
- Inconsistencies in sorting attachments;
- Loading translations at the appropriate time following WordPress 6.7 warning changes
For developers
- The metadata repository now accepts calls to the
fetch()
method without parameters; - New option
itemEditionStatusOptionOnFooterDropdown
, which can be passed to thetainacan-admin-ui-options
filter.
Get it now!
Tainacan version 0.21.12 is now available for download from the WordPress plugin repository: