Changelog History
Page 18
-
v2.69.0 Changes
October 03, 2018β Unit tests passing.
β Regression tests passing.
- Promisified all of the apis for migrations, including the option of iterators that return promises, and implemented migrations for old piece and page slugs that have not been deduplicated and thus can block new pages or pieces from taking a slug even though we have logic for this for new pages and pieces.
- π In-context editing support for areas and singletons that are schema fields of arrays. Leaves other, noncontextual data alone. Creating and editing entire array items contextually is outside the scope of this change; use an area rather than an array for that. Directly nested arrays are not supported, but you may use an area in an array in a widget in an array, etc.
.jpeg
files were slipping through with that extension. All new uploads will be correctly converted to.jpg
and go through the proper sizing process.- The
enableShowFields
option was missing some of its logic for fields of typecheckboxes
. Thanks to Anthony Tarlao. - A
_title
property is now included in attachments returned byapos.images.all
andapos.images.first
. - π When apostrophe cannot fix a unique key error, it is helpful to be able to see the last error, as well as the original one. This helps you figure it out if both a unique slug error and an unrelated unique key error are part of the puzzle. We still throw the original error, but we also attach the last error as a property of it, so you can see both.
- The
apos.areas.fromPlaintext
method now takes anoptions
parameter. You may set theel
property to an element name, in which case the markup is wrapped in that HTML element.options
may be omitted.
-
v2.68.1 Changes
September 27, 2018β Unit tests passing.
β Regression tests passing.
- π When we introduced allowedSubpageTypes and allowedHomepageTypes in 2.67.0, we broke support for different schemas in different page types. Those regressions are fixed here.
- 0οΈβ£ The default page type choice offered for a new page is the first type permitted by its parent page.
-
v2.68.0 Changes
September 26, 2018β Unit tests passing.
β Regression tests passing.
- π The
lateCriteria
cursor filter now works properly, allowing special mongodb criteria that are not allowed inside$and
to be merged into the criteria object at the last minute. - β A noisy warning produced on every page send by the latest version of Bluebird has been silenced.
- π Performance: explicitly shut off
sort()
for certain cases where we know only one document will be returned. This allows MongoDB to select a more efficient index more often. nlbr
Nunjucks filter no longer results in double-escaped markup. Thanks to Ulf Seltmann.- π The
apostrophe-global
module now supports theseparateWhileBusyMiddleware
option. Iby separate middleware that checks for the lock flag in apostrophe-global even if the regular middleware of this method has been disabled and/or overridden to cache in such a way as to make it unsuitable for this purpose. For normal use this option is not necessary. - π Fixes made to further reduce conflicts between sites with
apostrophe-multisite
. For instance, theapostrophe-workflow
module no longer breaks the dashboard. - The home page can now be copied. If you copy the home page, you get a new child of the home page with the same content. Thanks to Tim Otlik.
- π The
-
v2.67.0 Changes
September 14, 2018β Unit tests passing.
β Regression tests passing.
- Pages can now be locked down with the
allowedHomepageTypes
andallowedSubpageTypes
options, like this:
// Only one type allowed for the home page allowedHomepageTypes: [ 'home' ], allowedSubpageTypes: { // Two subpage types allowed for the home page 'home': [ 'default', 'apostrophe-blog-page' ], // No subpages for the blog page ("show pages" don't count) 'apostrophe-blog-page': [], // default page type can only have another default page as a subpage 'default': [ 'default' ] }
These options make it easy to prevent users from creating unintended scenarios, like nesting pages too deeply for your navigation design.
βͺ Pages now support batch operations, just like pieces do. The initial set includes trash, rescue, publish, unpublish, tag and untag. You can only rescue pages in this way if you are using the
trashInSchema
option of the docs module, which is always the case withapostrophe-workflow
. With the conventional trash can, it is unclear what should happen because you have not indicated where you want each page to be restored. New batch operations for pages can be added in the same way that they are added for pieces.π Important performance fix needed for those using the
apostrophe-pieces-orderings-bundle
module to create custom sort orders for pieces. Without this fix it is also possible to get a loader error and stop fetching content prematurely.βͺ The "revert" button for versions is now labeled "Revert to" to emphasize that it reverts to what you had at the end of that operation, not its beginning. Thanks to Fredrik Ekelund.
- Pages can now be locked down with the
-
v2.66.0 Changes
September 07, 2018- β‘οΈ Updated to CKEditor version 4.10.0. The CKEditor build now includes the CKEditor "widgets" feature (not to be confused with Apostrophe widgets). These are essential for modules like the forthcoming
apostrophe-rich-text-merge-tags
. - π
apos.areas.richText
andapos.areas.plaintext
no longer produce duplicate text. To achieve this, theapos.docs.walk
method no longer walks through the_originalWidgets
property. This property is only used to preserve the previous versions of widgets that the user lacks permission to edit due to schema field permissions. Exploration of this property byapos.docs.walk
led to the observed bug. - π» The browser-side implementation of
apos.utils.escapeHtml
now works properly.
- β‘οΈ Updated to CKEditor version 4.10.0. The CKEditor build now includes the CKEditor "widgets" feature (not to be confused with Apostrophe widgets). These are essential for modules like the forthcoming
-
v2.65.0 Changes
September 04, 2018β Unit tests passing.
β Regression tests passing.
Important fix for MongoDB replica sets: previously we used the
autoReconnect
option of the MongoDB driver by default. From now on, we use it only if the MongoDB URI does not refer to a replica set. The use ofautoReconnect
is inappropriate with a replica set because it will keep trying to connect to the node that went down. Leaving this option out results in automatic use of nodes that are up. Also see the apostrophe-db-mongo-3-driver module for a way to use the newermongodb+srv
URIs. Thanks to Matt Broadstone of MongoDB for his advice.π§ An
apostrophe-file
now has a default URL. The default_url
property of anapostrophe-file
piece is simply the URL of the file itself. This allowsapostrophe-file
to be included in your configuration for apostrophe-permalinks; picking a PDF in this way generates a direct link to the PDF, which is what the user expects. Note that if the developer elects to set up anapostrophe-files-pages
module that extendsapostrophe-pieces-pages
, that will still take precedence, so there is no bc break.π Clicking directly from one rich text widget into another did not work properly; the toolbar did not appear in this situation. This bug has been fixed. The bug only occurred when clicking in a second rich text widget without any intervening clicks outside of all rich text widgets.
π Also see expanded notes on version
2.64.1
, below, which contained several features missed in the original changelog.
-
v2.64.1 Changes
August 31, 2018β Unit tests passing.
β Regression tests passing.
π Improved Apostrophe's ability to redisplay the appropriate widget, array element, and field and call the user's attention to it when a schema field error is not detected until server-side validation takes place. This addresses problems that come up when fields become
required
at a later time, and/or data was originally created with an earlier release of Apostrophe that did not enforcerequired
in all situations. Browser-side validation is still preferred for ease of use but server-side validation no longer creates situations the user cannot easily resolve.Introduced the
apos.global.whileBusy
method. This method accepts a function to be run while no one is permitted to access the site. The provided function may return a promise, and that promise resolves before the site becomes accessible again. In the presence ofapostrophe-workflow
it is possible to mark only one locale as busy.π By default, the
apos.locks.lock
method waits until the lock is available before proceeding. However there is now await
option which can be set tofalse
to avoid waiting at all, or to any number of milliseconds. If the method fails because ofwait
, the error is the stringlocked
.π The
apos.locks.lock
method also now accepts awaitForSelf
option. By default, if the same process invokesapos.locks.lock
for the same lock in two requests simultaneously, one of the two will receive an error. WithwaitForSelf
, the second invocation will wait for the first to resolve and then obtain the lock.
-
v2.64.0 Changes
August 29, 2018β Unit tests passing.
β Regression tests passing.
- Apostrophe's "search suggestions" feature for
notFound.html
templates is now fully baked. It only takes two steps:
- Include an element like this in your
notFound.html
template:
<div data-apos-notfound-search-results></div>
- Set the
suggestions
option totrue
for theapostrophe-search
module.
π With
suggestions: true
, this feature no longer requires that you have a/search
page, it uses a dedicated route. See the documentation of theapostrophe-search
module for more information.- The
showFields
option is now available for checkboxes. The syntax is as follows:
{ "name": "awesomeBoolean", "label": "Awesome Boolean", "type": "boolean", "choices": [ { "value": true, "showFields": ["otherField1"] }, { "value": false, "showFields": ["otherField2"] } ] }
Thanks to falkodev.
- A useful error message appears if you try to use a
mongodb+srv
URL. These are meant for newer versions of the MongoDB driver. You can use them, but you must install the apostrophe-db-mongo-3-driver module first. The error message now explains this, addressing a common question on stackoverflow. - π Basic styles added for the most common rich text markup tags when within the bounds of an Apostrophe modal. Thanks to Lars Houmark.
- π Fixed UI overlap issue when joining with
apostrophe-page
. apos.images.all
,apos.images.first
, etc. now include_description
,_credit
and_creditUrl
when they can be inferred from anapostrophe-image
containing the attachment.apos.images.srcset
helper improved. It is now smart enough to limit the image sizes it offers based on what it knows about the size of the original. Thanks to Fredrik Ekelund.- π Fixes to CSS asset URL generation to pass validation.
- π Performance: eliminated use of
$or
MongoDB queries with regard to pages in the trash. MongoDB tests demonstrate that$ne: true
is faster than$or
for our purposes.
- Apostrophe's "search suggestions" feature for
-
v2.63.0 Changes
August 15, 2018β Unit tests passing.
β Regression tests passing.
- βPromise eventsβ have arrived. This is a major feature. Promise events will completely
replace
callAll
in Apostrophe 3.x. For 2.x, all existing invocations ofcallAll
in the core Apostrophe module now also emit a promise event. For instance, when thedocBeforeInsert
callAll method is invoked, Apostrophe also emits thebeforeInsert
promise event on the π apostrophe-docs` module.
Other modules may listen for this event by writing code like this:
`self.on('apostrophe-docs:beforeInsert', 'chooseASpecialist', function(req, doc, options) { // Modify `doc` here. You may return a promise, and it will resolve before // any more handlers run. Then the doc is inserted });
The above code adds a new
chooseASpecialist
method to your module. This way, the method can be overridden by assigning a new function toself.chooseASpecialist
in a module that extends it, or its behavior can be extended in the usual way following thesuper
pattern.But, since it does not have the same name as the event (attempting to register a method of the same name will throw an error), it is unlikely that parent class modules and subclass modules will have unintentional conflicts.
π See the original github issue for a more complete description of the feature and the reasoning behind it.
Your existing callAll methods will still work. But, we recommend you start migrating to be π ready to move to 3.x in the future... and because returning promises is just a heck of a lot nicer. You will have fewer problems.
- π Optional SVG support for
apostrophe-attachments
. To enable it, set thesvgImages
option to π§true
when configuring theapostrophe-attachments
module. SVG files can be uploaded just like other image types. Manual cropping is not available. However, since most SVG files play very well with backgrounds, the SVG file is displayed in its entirety without distortion at the largest size that fits within the aspect ratio of the widget in question, if any (background-size: contain
is used). If you have overriddenwidget.html
forapostrophe-images-widgets
, you will want β to refer to the latest version ofwidgetBase.html
for the technique we used here to ensure SVG files do not break the slideshowβs overall height. - π New
apos.templates.prepend
andapos.templates.append
methods. Callapos.templates.prepend('head', function(req) { ... })
to register a function to be called just after the head tag is opened each time a page is rendered. The output of your function is inserted into the markup. The standard named locations arehead
,body
,contextMenu
andmain
. This is π convenient when writing modules that add new features to Apostrophe. For project level work also see the named Nunjucks blocks already provided inouterLayoutBase.html
. apos.singleton
now accepts anareaOptions
option, which can receive any option that can be passed toapos.area
. Thanks to Manoj Krishnan.- π Apostropheβs βprojectorβ jQuery plugin now respects the
outerHeight
of the tallest slideshow item, not just the inner height. apos.area
now accepts anaddLabel
option for each widget type in the area. Thanks to Fredrik Ekelund.- π» UI improvements to versioning. Thanks to Lars Houmark.
- βͺ Button to revert to the current version has been replaced with a label indicating it is current, βͺ since reverting to the current version has no effect.
- βPage settingsβ can now be accessed for any page in the trash via βreorganize.β When
working with
apostrophe-workflow
, this is often required to commit the fact that a page is in the trash. - The
uploadfs
module now has aprefix
option. If present, the prefix is prepended to all uploadfs paths before they reach the storage layer, and is also prepended to URLs. In practice, this means that a single S3 bucket can be used to host multiple sites without all of the uploaded media jumbling together in/attachments
. Theapostrophe-multisite
module now leverages this.
- βPromise eventsβ have arrived. This is a major feature. Promise events will completely
replace
-
v2.62.0 Changes
August 09, 2018β Unit tests passing.
β Regression tests passing.
- Introduced a
findWithProjection()
method that is added to all MongoDB collection objects. All Apostrophe core modules are migrating towards using this method rather thanfind()
when working directly with MongoDB collections. If you are using the standard MongoDB 2.x driver that is included with Apostrophe, this just calls regularfind()
. When using the forthcomingapostrophe-db-mongo-3-driver
module to replace that with a newer driver that supports the full features of MongoDB 3.6, 4.0 and beyond, this method will provide backwards compatibility by accepting a projection as the second argument likefind()
did until the 3.x driver was released. Developers wishing to be compatible with both drivers will want to start using this method. Again, this only concerns you if you are querying MongoDB directly and passing a projection to find() as the second argument. And if you don't care about using the 3.x driver, you do not have to change anything. - π Various UX improvements and bug fixes to the page versions dialog box. Thanks to Lars Houmark.
- β‘οΈ The widget wrapper is updated on the fly with new classes if they change due to edits. Thanks to Fredrik Ekelund.
- π§ When configuring a
date
field, you may pass apikadayOptions
property. This object is passed on to thepikaday
library. Thanks to Lars Houmark. - The
counts: true
option forpiecesFilters
now works properly with joins.
- Introduced a