diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index cdffd6236..76855c74c 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -49,6 +49,7 @@ - fix: HTTP proxy not passing form elements through - upgrade script patches some corrupted commerce template settings - fix: bits of other panels showing through in admin bar + - fix: Edit Branch on threads makes them not show up in CS - The Events Calendar is now the new Calendar with some fun new features. All your existing Events Calendars will be migrated automatically. - rfe: multiple redirects on a page - which one? diff --git a/docs/upgrades/templates-7.3.0/default-wiki-front-page.tmpl b/docs/upgrades/templates-7.3.0/default-wiki-front-page.tmpl index 3041897a5..a5a23b730 100644 --- a/docs/upgrades/templates-7.3.0/default-wiki-front-page.tmpl +++ b/docs/upgrades/templates-7.3.0/default-wiki-front-page.tmpl @@ -21,9 +21,9 @@

- +
diff --git a/etc/WebGUI.conf.original b/etc/WebGUI.conf.original index 3c01cf0a0..87a1bd686 100644 --- a/etc/WebGUI.conf.original +++ b/etc/WebGUI.conf.original @@ -416,7 +416,7 @@ #"availableDictionaries" : [ # { -# "id" : "en", +# "id" : "en_US", # "name" : "English", # "default" : "1" # }, diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 6239d18d4..992f0d95c 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -1847,7 +1847,7 @@ sub update { =head2 view ( ) -Returns "". +The default view method for any asset that doesn't define one. Under all normal circumstances this should be overridden or your asset won't have any output. =cut diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 22f92b019..7f66107ec 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -1083,8 +1083,8 @@ sub view { left join assetData on assetData.assetId=Thread.assetId and Thread.revisionDate = assetData.revisionDate where asset.parentId=".$self->session->db->quote($self->getId)." and asset.state='published' and asset.className='WebGUI::Asset::Post::Thread' and assetData.revisionDate=(SELECT max(revisionDate) from assetData - where assetData.assetId=asset.assetId) and (assetData.status='approved' - or assetData.tagId=".$self->session->db->quote($self->session->scratch->get("versionTag")).") + where assetData.assetId=asset.assetId and (assetData.status='approved' + or assetData.tagId=".$self->session->db->quote($self->session->scratch->get("versionTag")).")) group by assetData.assetId order by Thread.isSticky desc, ".$sortBy." ".$sortOrder; my $p = WebGUI::Paginator->new($self->session,$self->getUrl,$self->get("threadsPerPage")); $p->setDataByQuery($sql); diff --git a/lib/WebGUI/AssetBranch.pm b/lib/WebGUI/AssetBranch.pm index 37a3d0089..d3a142a89 100644 --- a/lib/WebGUI/AssetBranch.pm +++ b/lib/WebGUI/AssetBranch.pm @@ -46,7 +46,7 @@ Duplicates this asset and the entire subtree below it. Returns the root of the sub duplicateBranch { my $self = shift; - my $newAsset = $self->duplicate; + my $newAsset = $self->duplicate({skipAutoCommitWorkflows=>1}); my $contentPositions = $self->get("contentPositions"); foreach my $child (@{$self->getLineage(["children"],{returnObjects=>1})}) { @@ -292,7 +292,7 @@ sub www_editBranchSave { $data{url} .= $descendant->get("url"); } } - my $newRevision = $descendant->addRevision(\%data); + my $newRevision = $descendant->addRevision(\%data, undef, {skipAutoCommitWorkflows=>1}); foreach my $form ($self->session->form->param) { if ($form =~ /^metadata_(.*)$/) { my $fieldName = $1; diff --git a/lib/WebGUI/AssetClipboard.pm b/lib/WebGUI/AssetClipboard.pm index 7a5cdda27..46773f8ac 100644 --- a/lib/WebGUI/AssetClipboard.pm +++ b/lib/WebGUI/AssetClipboard.pm @@ -61,15 +61,24 @@ sub cut { #------------------------------------------------------------------- -=head2 duplicate ( ) +=head2 duplicate ( [ options ] ) Duplicates this asset, returning the new asset. +=head3 options + +A hash reference of options that can modify how this method works. + +=head4 skipAutoCommitWorkflows + +Assets that normally autocommit their workflows (like CS Posts, and Wiki Pages) won't if this is true. + =cut sub duplicate { my $self = shift; - my $newAsset = $self->getParent->addChild($self->get); + my $options = shift; + my $newAsset = $self->getParent->addChild($self->get, undef, undef, {skipAutoCommitWorkflows=>$options->{skipAutoCommitWorkflows}}); my $sth = $self->session->db->read("select * from metaData_values where assetId = ?", [$self->getId]); while (my $h = $sth->hashRef) { $self->session->db->write("insert into metaData_values (fieldId, assetId, value) values (?, ?, ?)", [$h->{fieldId}, $newAsset->getId, $h->{value}]); diff --git a/lib/WebGUI/AssetLineage.pm b/lib/WebGUI/AssetLineage.pm index 281e84f5c..4476dbcf9 100644 --- a/lib/WebGUI/AssetLineage.pm +++ b/lib/WebGUI/AssetLineage.pm @@ -36,7 +36,7 @@ These methods are available from this class: #------------------------------------------------------------------- -=head2 addChild ( properties [, id, revisionDate ] ) +=head2 addChild ( properties [, id, revisionDate, options ] ) Adds a child asset to a parent. Creates a new AssetID for child. Makes the parent know that it has children. Adds a new asset to the asset table. Returns the newly created Asset. @@ -52,6 +52,14 @@ A unique 22 character ID. By default WebGUI will generate this and you should a An epoch representing the time this asset was created. +=head3 options + +A hash reference that allows passed in options to change how this method behaves. + +=head4 skipAutoCommitWorkflows + +If this is set to 1 assets that normally autocommit their workflows (like CS Posts) won't do that. + =cut sub addChild { @@ -59,6 +67,7 @@ sub addChild { my $properties = shift; my $id = shift || $self->session->id->generate(); my $now = shift || $self->session->datetime->time(); + my $options = shift; # add a few things just in case the creator forgets $properties->{ownerUserId} ||= '3'; $properties->{groupIdEdit} ||= '12'; @@ -80,7 +89,7 @@ sub addChild { $properties->{parentId} = $self->getId; my $temp = WebGUI::Asset->newByPropertyHashRef($self->session,$properties); $temp->{_parent} = $self; - my $newAsset = $temp->addRevision($properties,$now); + my $newAsset = $temp->addRevision($properties,$now, {skipAutoCommitWorkflows=>$options->{skipAutoCommitWorkflows}}); $self->updateHistory("added child ".$id); $self->session->http->setStatus(201,"Asset Creation Successful"); return $newAsset; diff --git a/lib/WebGUI/AssetVersioning.pm b/lib/WebGUI/AssetVersioning.pm index daf73ea48..c58cf8c56 100644 --- a/lib/WebGUI/AssetVersioning.pm +++ b/lib/WebGUI/AssetVersioning.pm @@ -40,7 +40,7 @@ These methods are available from this class: #------------------------------------------------------------------- -=head2 addRevision ( properties [ , revisionDate ] ) +=head2 addRevision ( properties [ , revisionDate, options ] ) Adds a revision of an existing asset. Note that programmers should almost never call this method directly, but rather use the update() method instead. @@ -52,13 +52,22 @@ A hash reference containing a list of properties to associate with the child. An epoch date representing the date/time stamp that this revision was created. Defaults to$self->session->datetime->time(). +=head3 options + +A hash reference of options that change the behavior of this method. + +=head4 skipAutoCommitWorkflows + +If this is set to 1 then assets that would normally autocommit their workflow (like CS Posts) will instead add themselves to the normal working version tag. + =cut sub addRevision { my $self = shift; my $properties = shift; my $now = shift ||$self->session->datetime->time(); - my $autoCommitId = $self->getAutoCommitWorkflowId(); + my $options = shift; + my $autoCommitId = $self->getAutoCommitWorkflowId() unless ($options->{skipAutoCommitWorkflows}); my $workingTag = ($autoCommitId) ? WebGUI::VersionTag->create($self->session, {groupToUse=>'12', workflowId=>$autoCommitId}) : WebGUI::VersionTag->getWorking($self->session); $self->session->db->beginTransaction; $self->session->db->write("insert into assetData (assetId, revisionDate, revisedBy, tagId, status, url,