Changeset 1731
- Timestamp:
- 04/02/08 23:27:20 (23 months ago)
- Location:
- branches/release-33
- Files:
-
- 4 modified
-
build/mt-dists/default.mk (modified) (1 diff)
-
lib/MT/Entry.pm (modified) (4 diffs)
-
lib/MT/ObjectAsset.pm (modified) (1 diff)
-
lib/MT/Upgrade.pm (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-33/build/mt-dists/default.mk
r1722 r1731 2 2 3 3 PRODUCT_VERSION = 4.15 4 SCHEMA_VERSION = 4.005 14 SCHEMA_VERSION = 4.0052 5 5 API_VERSION = 4.15 6 6 -
branches/release-33/lib/MT/Entry.pm
r1618 r1731 622 622 object_id => $entry->id, 623 623 blog_id => $entry->blog_id, 624 object_ds => $entry->datasource 624 object_ds => $entry->datasource, 625 embedded => 1, 625 626 }); 626 627 my %assets = map { $_->asset_id => $_->id } @assets; … … 629 630 my $innards = $2; 630 631 631 # is asset exists?632 my $asset = MT->model('asset')->load({ id => $id }) or next;633 634 632 # reference to an existing asset... 635 633 if (exists $assets{$id}) { 636 634 $assets{$id} = 0; 637 635 } else { 636 # is asset exists? 637 my $asset = MT->model('asset')->load({ id => $id }) or next; 638 638 639 my $map = new MT::ObjectAsset; 639 640 $map->blog_id($entry->blog_id); … … 641 642 $map->object_ds($entry->datasource); 642 643 $map->object_id($entry->id); 644 $map->embedded(1); 643 645 $map->save; 644 646 $assets{$id} = 0; … … 646 648 } 647 649 if (my @old_maps = grep { $assets{$_->asset_id} } @assets) { 648 my @old_ids = map { $_->id } @old_maps; 649 MT::ObjectAsset->remove( { id => \@old_ids }); 650 my @old_ids = map { $_->id } grep { $_->embedded } @old_maps; 651 MT::ObjectAsset->remove( { id => \@old_ids }) 652 if @old_ids; 650 653 } 651 654 return 1; -
branches/release-33/lib/MT/ObjectAsset.pm
r1523 r1731 18 18 object_ds => 'string(50) not null', 19 19 asset_id => 'integer not null', 20 embedded => 'boolean', 20 21 }, 21 22 indexes => { 22 blog_id => 1, 23 object_id => 1, 23 blog_obj => { 24 columns => ['blog_id', 'object_ds', 'object_id'], 25 }, 24 26 asset_id => 1, 25 object_ds => 1, 27 }, 28 defaults => { 29 embedded => 0, 26 30 }, 27 31 child_of => 'MT::Blog', -
branches/release-33/lib/MT/Upgrade.pm
r1583 r1731 548 548 priority => 5.1, 549 549 }, 550 'core_migrate_commenter_auth' => { 551 code => \&migrate_commenter_auth, 552 version_limit => 3.3101, 553 priority => 3.1, 554 }, 550 555 'core_deprecate_bitmask_permissions' => { 551 556 code => \&deprecate_bitmask_permissions, … … 557 562 version_limit => 4.0002, 558 563 priority => 3.3, 559 },560 'core_migrate_commenter_auth' => {561 code => \&migrate_commenter_auth,562 version_limit => 3.3101,563 priority => 3.1,564 564 }, 565 565 'core_populate_authored_on' => { … … 689 689 type => 'author', 690 690 label => 'Adding new feature widget to dashboard...', 691 condition => sub { 692 my ($user) = @_; 693 $user->type == MT::Author::AUTHOR(); # AUTHOR records only 694 }, 691 695 code => sub { 692 696 my ($user) = @_; … … 703 707 } 704 708 $user->widgets($widget_store); 705 $user->save;706 709 }, 707 710 }, … … 775 778 } 776 779 $blog->page_layout($layout); 777 $blog->save;778 780 }, 779 781 }, … … 792 794 my $basename = MT::Util::make_unique_author_basename($author); 793 795 $author->basename($basename); 794 $author->save;795 796 }, 796 797 }, … … 806 807 updater => { 807 808 type => 'entry', 808 label => 'Assigning entry comment and trackback count...',809 label => 'Assigning entry comment and TrackBack counts...', 809 810 condition => sub { 810 811 require MT::Comment; … … 834 835 # it doesn't have the unnecessary save. 835 836 code => sub { 1; }, 837 }, 838 }, 839 'core_assign_object_embedded' => { 840 version_limit => 4.0052, 841 priority => 3.2, 842 updater => { 843 type => 'objectasset', 844 label => 'Assigning embedded flag to asset placements...', 845 code => sub { 846 $_[0]->embedded(1); 847 }, 848 sql => 'update mt_objectasset set objectasset_embedded=1', 836 849 }, 837 850 },
