Content is saved and published, but status displays as 'none' - bolt-cms

I've created some content with this:
$empty->values['id'] = (isset($exists[0]->id)) ? $exists[0]->id : null;
$empty->values['name'] = $video->name;
$empty->values['vimeo_id'] = $video->vimeo_id;
$empty->values['description'] = ($video->description != null) ? $video->description : '';
$empty->values['created_time'] = $video->created_time;
$empty->values['modified_time'] = $video->modified_time;
$empty->values['embed_html'] = $video->embed_html;
$empty->values['status'] = 'publish';
$updated = $this->app['storage']->saveContent($empty);
And when I visit the backend I can see that it's created but the status is 'none' - see screenshot.

The status should be "published" in the current release of bolt.

Related

Report don't display any data

I'm working on D365FO. I did create a report added a query to dataset that is based on a tmp table.
Now when I try to generate the report I get just the precisiondesign. No data is shown in it. How can I fix this ?
I think this is problem is somewhere outside of my code because I tried to generate a already created report and had the same problem.
[SrsReportParameterAttribute(classStr(ProductionStatusContract))]
class ProductionStatusDP extends SrsReportDataProviderBase
{
ProductionStatusTmp ProductionStatusTmp;
ProdTable prodtable;
SalesTable salestable;
InventDim inventdim;
SalesLine salesline;
public void processReport()
{
ProductionStatusContract contract = this.parmDataContract() as
ProductionStatusContract;
date FromDate;
date ToDate;
boolean DateBetween = false;
if(contract.parmToDate() && contract.parmFromDate())
{
ToDate = contract.parmToDate();
FromDate = contract.parmFromDate();
DateBetween = true;
}
super();
delete_from ProductionStatusTmp;
ProductionStatusTmp.clear();
while select prodtable where prodtable.CollectRefLevel == 0
join inventdim where prodtable.InventDimId == inventdim.inventDimId
join salesline where prodtable.InventRefType == salesline.InventRefType
&& prodtable.InventRefId == salesline.SalesId
&& prodtable.InventRefTransId == salesline.InventTransId
&& prodtable.InventRefType == inventreftype::Sales
{
ProductionStatusTmp.clear();
Info(strFmt("%1", prodtable.ProdId));
ProductionStatusTmp.AcceptedDate = prodtable.CreatedDateTime;
ProductionStatusTmp.ProdWeek = wkOfYr(prodtable.CreatedDateTime) + year(prodtable.CreatedDateTime);
ProductionStatusTmp.ExternalNum = salesline.ExternalItemId;
ProductionStatusTmp.Progress = ((prodtable.qtycalc * 100) / prodtable.QtySched);
ProductionStatusTmp.Quantity = prodtable.QtyCalc;
ProductionStatusTmp.AcceptedBy = prodtable.CreatedBy;
ProductionStatusTmp.ProdItemId = InventDim.InventLocationId;
ProductionStatusTmp.Ware = prodtable.Name;
ProductionStatusTmp.ProductionStatus = prodtable.ProdStatus;
ProductionStatusTmp.Produced = prodtable.QtySched;
ProductionStatusTmp.insert();
}
}
[SrsReportDataSetAttribute(tableStr(ProductionStatusTmp))]
public ProductionStatusTmp getProductionStatusTmp()
{
select ProductionStatusTmp;
return ProductionStatusTmp;
}
}
You will have to verify that your report does indeed display the data you provide.
You can do this by providing fixed static data in your data provider to see if shows up in the SSRS report preview.
See this video for an example to see how.

Binding Json data to Kendo treeview MVC4

My Kendo Tree-view has many child nodes and sub nodes .Problem with getting sub child's nodes with redundant code
Here is my code .
nodes = rep.GetTreeViewData(CompanyId);
var productTreeData = nodes.Select(p => new
{
Text = p.CategoryName,
Url = p.ActionLink,
hasChildren = p.SubCategories.Any(),
// Expanded = true,
EntityType = p.EntityType,
Selected = currurl.ToLower() == p.ActionLink.ToLower() ? true : false,
ImageUrl = p.EntityType == "Company" ? "/Content/Images/company.gif" : "/Content/Images/geolocation1.gif",
Children = p.SubCategories.Select(c => new
{
Text = c.SubCategoryName,
Url = c.ActionLink,
// Expanded = true,
hasChildren = c.SubCategories.Any(),
EntityType = c.EntityType,
Selected = currurl.ToLower() == c.ActionLink.ToLower() ? true : false,
ImageUrl = c.EntityType == "Company" ? "/Content/Images/company.gif" : "/Content/Images/geolocation1.gif",
Children = c.SubCategories.Select(d => new
{
Text = d.SubCategoryName,
Url = d.ActionLink,
// Expanded = true,
hasChildren = d.SubCategories.Any(),
EntityType = d.EntityType,
Selected = currurl.ToLower() == d.ActionLink.ToLower() ? true : false,
ImageUrl = d.EntityType == "Company" ? "/Content/Images/company.gif" : "/Content/Images/geolocation1.gif",
Children = d.SubCategories.Select(f => new
{
Text = f.SubCategoryName,
Url = f.ActionLink,
//Expanded = true,
hasChildren = f.SubCategories.Any(),
EntityType = f.EntityType,
Selected = currurl.ToLower() == f.ActionLink.ToLower() ? true : false,
ImageUrl = f.EntityType == "Company" ? "/Content/Images/company.gif" : "/Content/Images/geolocation1.gif",
Children = f.SubCategories.Select(g => new
{
Text = g.SubCategoryName,
Url = g.ActionLink,
// Expanded = true,
hasChildren = g.SubCategories.Any(),
EntityType = g.EntityType,
Selected = currurl.ToLower() == g.ActionLink.ToLower() ? true : false,
ImageUrl = g.EntityType == "Company" ? "/Content/Images/company.gif" : "/Content/Images/geolocation1.gif",
})
})
})
})
});
This is my view
#(Html.Kendo().TreeView()
.Name("treeview-right")
.ExpandAll(true)
//.LoadOnDemand(false)
//.Events(events=>events.DataBound("DataBound"))
.DataSource(d => d
.Model(m => m
.HasChildren("hasChildren")
.Children("Children"))
.Read(r => r.Action("_ProductTree", "Home")))
.DataTextField("Text")
.DataUrlField("Url")
.DataImageUrlField("ImageUrl")
)
By this process am getting all child's and sub child's of individual parent up to four level hierarchy ..if i need another level i need to write one more children code.
Am struggling from 2 days to simplify this process .
Thanks
This looks like it could be solved with recursion. This should be pretty close.
var productTreeData = new ListofYourTreeViewModelHere();
foreach (var node in rep.GetTreeViewData(CompanyId))
{
productTreeData.Add(FillTree(node));
}
...
}
private YourTreeViewModelHere FillTree(p)
{
var tv = new YourTreeViewModelHere();
tv.Text = p.CategoryName,
tv.Url = p.ActionLink,
tv.hasChildren = p.SubCategories.Any(),
tv.EntityType = p.EntityType,
tv. Selected = currurl.ToLower() == p.ActionLink.ToLower() ? true : false,
tv.ImageUrl = p.EntityType == "Company" ? "/Content/Images/company.gif" : "/Content/Images/geolocation1.gif";
foreach(var sub in p.SubCategories)
{
tv.Children.Add(FillTree(x));
}
}

Joomla 1.5 editing head information

I was recently brought in to fix up a website that was originally published using Joomla v1.5. There are a few problems regarding the structure of the main page.
I would like to update the doctype to the newer html5 standard from xhtml transitional. Also, on every page of the site, there is a < link > tag that appears before the < head > tag. Does anyone know how I can make these edits?
When I go to edit the template html code, all I see is the following:
<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
include_once (dirname(__FILE__).DS.'libs'.DS.'ja.template.helper.php');
if( defined('_DEMO_MODE_') ) {
$tmplTools = JATemplateHelper::getInstance($this, array('ui', JA_TOOL_SCREEN, JA_TOOL_MENU, JA_TOOL_COLOR, 'main_layout', 'direction'));
} else {
$tmplTools = JATemplateHelper::getInstance($this, array('ui', JA_TOOL_SCREEN, JA_TOOL_MENU, 'main_layout', 'direction'));
}
//Calculate the width of template
$tmplWidth = '';
$tmplWrapMin = '100%';
switch ($tmplTools->getParam(JA_TOOL_SCREEN)){
case 'auto':
$tmplWidth = '97%';
break;
case 'fluid':
$tmplWidth = intval($tmplTools->getParam('ja_screen-fluid-fix-ja_screen_width'));
$tmplWidth = $tmplWidth ? $tmplWidth.'%' : '90%';
break;
case 'fix':
$tmplWidth = intval($tmplTools->getParam('ja_screen-fluid-fix-ja_screen_width'));
$tmplWrapMin = $tmplWidth ? ($tmplWidth+1).'px' : '771px';
$tmplWidth = $tmplWidth ? $tmplWidth.'px' : '770px';
break;
default:
$tmplWidth = intval($tmplTools->getParam(JA_TOOL_SCREEN));
$tmplWrapMin = $tmplWidth ? ($tmplWidth+1).'px' : '981px';
$tmplWidth = $tmplWidth ? $tmplWidth.'px' : '980px';
break;
}
$tmplTools->setParam ('tmplWidth', $tmplWidth);
$tmplTools->setParam ('tmplWrapMin', $tmplWrapMin);
//Main navigation
$ja_menutype = $tmplTools->getParam(JA_TOOL_MENU, 'css');
$jamenu = null;
if ($ja_menutype && $ja_menutype != 'none') {
$japarams = new JParameter('');
$japarams->set( 'menutype', $tmplTools->getParam('menutype', 'mainmenu') );
$japarams->set( 'menu_images_align', 'left' );
$japarams->set( 'menupath', $tmplTools->templateurl() .'/ja_menus');
$japarams->set('menu_images', 1); //0: not show image, 1: show image which set in menu item
$japarams->set('menu_background', 1); //0: image, 1: background
$japarams->set('mega-colwidth', 200); //Megamenu only: Default column width
$jamenu = $tmplTools->loadMenu($japarams, $ja_menutype);
}
//End for main navigation
$layout = $tmplTools->getLayout ();
if ($layout) {
$tmplTools->display ($layout);
}
You can edit the template with Tools->Template Manager->check template->Edit->Edit HTML or Edit CSS.
It can be quite scary to do this through an HTML editor, but its available.
To my knowledge you need Super Admin rights for this

query not displaying if another table has null value(sequence contains no elements)

I have a problem with the following code. It displays details if all tables have at least one value, but nothing if at least one table does not have a value. I get the message
sequence contains no elements.
My code as follow:
public sneakerDetails GetSneakerDetails(int id)
{
IQueryable<sneakerDetails> query = from sneaks in _context.sneakers
from image in _context.sneakerImages
from website in _context.sneakerWebsites
// from website in _context.sneakerWebsites
where sneaks.sneaker_id == id && image.sneaker_id == website.sneaker_id && sneaks.sneaker_id == website.sneake_id
select new sneakerDetails
{
//sneaker_id = sneaks.sneaker_id,
Colorway = sneaks.Colorway,
Name = sneaks.Name,
description = sneaks.description,
imageAlternative = image.imageAlternative,
release_date = sneaks.release_date,
imageB = image.imageB,
imageF = image.imageF,
imageL = image.imageL,
imageR = image.imageR,
website = website.website,
websiteLogo = website.websiteLogo
};
return query.ToList().First();
I have tried to change the return value to FirstOrDefault but when i click a particular sneaker it displays only the title and no data.
Do i need to write an if statement for both tables?
Try with DefaultIfEmpty():
from sneaks in _context.sneakers.DefaultIfEmpty()
from image in _context.sneakerImages.DefaultIfEmpty()
from website in _context.sneakerWebsites.DefaultIfEmpty()
// from website in _context.sneakerWebsites
where sneaks.sneaker_id == id
&& image.sneaker_id == website.sneaker_id
&& sneaks.sneaker_id == website.sneake_id
select new sneakerDetails
{
//sneaker_id = sneaks.sneaker_id,
Colorway = sneaks.Colorway,
Name = sneaks.Name,
description = sneaks.description,
imageAlternative = image.imageAlternative,
release_date = sneaks.release_date,
imageB = image.imageB,
imageF = image.imageF,
imageL = image.imageL,
imageR = image.imageR,
website = website.website,
websiteLogo = website.websiteLogo
};

LINQ2SQL - FirstItem

How do you get the first item only? It seems like I have to do the following otherwise i will get an error as if it was a multiple item and i can't get just the first element of it.
My goal is i would like to remove the foreach loop from the code below.
MetaDataPropertyBag propertyBag = new MetaDataPropertyBag();
var dbResultsOfType = db.spi_GetTypesByCaseType(caseType);
foreach (var item in dbResultsOfType)
{
if (item.ASSOC_TYPE_ID == primaryChildTypeID)
{
propertyBag.CaseTypeDesc = item.DESCRIPTION;
propertyBag.Required = item.IS_REQUIRED == 'Y' ? true : false;
propertyBag.Parent = item.PARENT_ID.Value;
propertyBag.Child = item.CHILD_ID.Value;
propertyBag.AssocTypeID = item.ASSOC_TYPE_ID;
propertyBag.CaseTypeID = item.CASE_TYPE_ID;
break; // Only one entry is requested
}
}
FirstorDefault should do it:
MSDN article on firstordefault
Here is one way to do it:
var first = dbResultsOfType.FirstOrDefault(item => item.ASSOC_TYPE_ID == primaryChildTypeID);
if (first != null) {
propertyBag.CaseTypeDesc = first.DESCRIPTION;
propertyBag.Required = first.IS_REQUIRED == 'Y' ? true : false;
propertyBag.Parent = first.PARENT_ID.Value;
propertyBag.Child = first.CHILD_ID.Value;
propertyBag.AssocTypeID = first.ASSOC_TYPE_ID;
propertyBag.CaseTypeID = first.CASE_TYPE_ID;
}