@mikro-orm/core 7.2.12-dev.10 → 7.2.12-dev.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/EntityManager.js CHANGED
@@ -569,7 +569,7 @@ export class EntityManager {
569
569
  (parent?.class === prop.targetMeta.root.class && parent.propName === prop.inversedBy)) {
570
570
  continue;
571
571
  }
572
- options = { ...options, filters: QueryHelper.mergePropertyFilters(prop.filters, options.filters) };
572
+ const propOptions = { ...options, filters: QueryHelper.mergePropertyFilters(prop.filters, options.filters) };
573
573
  // For polymorphic relations, check all targets for filters (not just the first targetMeta)
574
574
  const targets = prop.polymorphic && prop.polymorphTargets?.length ? prop.polymorphTargets : [prop.targetMeta];
575
575
  // `applyFilters()` can only return a condition when some filter is registered globally or on the target
@@ -578,7 +578,7 @@ export class EntityManager {
578
578
  }
579
579
  let hasActiveFilter = false;
580
580
  for (const targetMeta of targets) {
581
- const cond = await this.applyFilters(targetMeta.class, {}, options.filters, 'read', options);
581
+ const cond = await this.applyFilters(targetMeta.class, {}, propOptions.filters, 'read', propOptions);
582
582
  if (!Utils.isEmpty(cond)) {
583
583
  hasActiveFilter = true;
584
584
  break;
@@ -611,7 +611,11 @@ export class EntityManager {
611
611
  const targets = prop.polymorphic && prop.polymorphTargets?.length ? prop.polymorphTargets : [prop.targetMeta];
612
612
  for (const targetMeta of targets) {
613
613
  const before = hint.children.length;
614
- await this.autoJoinRefsForFilters(targetMeta, { ...options, populate: hint.children }, { class: meta.root.class, propName: prop.name });
614
+ await this.autoJoinRefsForFilters(targetMeta, {
615
+ ...options,
616
+ populate: hint.children,
617
+ filters: QueryHelper.mergePropertyFilters(prop.filters, options.filters),
618
+ }, { class: meta.root.class, propName: prop.name });
615
619
  // For polymorphic relations, `hint.children` is applied to every polymorph target during
616
620
  // population, so drop any auto-added hint whose field does not exist on every target —
617
621
  // otherwise the shared `:ref` would crash when applied to a target lacking it (GH #7722).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "7.2.12-dev.10",
3
+ "version": "7.2.12-dev.12",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
5
5
  "keywords": [
6
6
  "data-mapper",
package/utils/Utils.js CHANGED
@@ -153,7 +153,7 @@ export function parseJsonSafe(value) {
153
153
  /** Collection of general-purpose utility methods used throughout the ORM. */
154
154
  export class Utils {
155
155
  static PK_SEPARATOR = '~~~';
156
- static #ORM_VERSION = '7.2.12-dev.10';
156
+ static #ORM_VERSION = '7.2.12-dev.12';
157
157
  /** Default session variable name backing an RLS filter argument (`current_setting('mikro.<filter>.<arg>')`). */
158
158
  static getRlsSettingName(filterName, argName) {
159
159
  return `mikro.${filterName}.${argName}`;