Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php |
— | — | @@ -537,6 +537,8 @@ |
538 | 538 | } else { |
539 | 539 | $this->updateRedirects($subject->getDBKey(),$subject->getNamespace()); |
540 | 540 | } |
| 541 | + // always make an ID (pages without ID cannot be in qurey results, not even in fixed value queries!): |
| 542 | + $sid = $this->makeSMWPageID($subject->getDBkey(),$subject->getNamespace(),''); |
541 | 543 | $db =& wfGetDB( DB_MASTER ); |
542 | 544 | |
543 | 545 | // do bulk updates: |
— | — | @@ -552,17 +554,16 @@ |
553 | 555 | if ($value->isValid()) { |
554 | 556 | if ($value->getTypeID() == '_txt') { |
555 | 557 | $up_text2[] = |
556 | | - array( 's_id' => $this->makeSMWPageID($subject->getDBkey(),$subject->getNamespace(),''), |
| 558 | + array( 's_id' => $sid, |
557 | 559 | 'p_id' => $this->makeSMWPageID($property->getDBkey(),SMW_NS_PROPERTY,''), |
558 | 560 | 'value_blob' => $value->getXSDValue() ); |
559 | 561 | } elseif ($value->getTypeID() == '_wpg') { |
560 | 562 | $up_rels2[] = |
561 | | - array( 's_id' => $this->makeSMWPageID($subject->getDBkey(),$subject->getNamespace(),''), |
| 563 | + array( 's_id' => $sid, |
562 | 564 | 'p_id' => $this->makeSMWPageID($property->getDBkey(),SMW_NS_PROPERTY,''), |
563 | 565 | 'o_id' => $this->makeSMWPageID($value->getDBkey(),$value->getNamespace(),'') ); |
564 | 566 | $oid = $value->getArticleID(); |
565 | 567 | } elseif ($value->getTypeID() == '__nry') { |
566 | | - $sid = $this->makeSMWPageID($subject->getDBkey(),$subject->getNamespace(),''); |
567 | 568 | $bnode = $this->makeSMWBnodeID($sid); |
568 | 569 | $up_rels2[] = |
569 | 570 | array( 's_id' => $sid, |
— | — | @@ -600,7 +601,7 @@ |
601 | 602 | } |
602 | 603 | } else { |
603 | 604 | $up_atts2[] = |
604 | | - array( 's_id' => $this->makeSMWPageID($subject->getDBkey(),$subject->getNamespace(),''), |
| 605 | + array( 's_id' => $sid, |
605 | 606 | 'p_id' => $this->makeSMWPageID($property->getDBkey(),SMW_NS_PROPERTY,''), |
606 | 607 | 'value_unit' => $value->getUnit(), |
607 | 608 | 'value_xsd' => $value->getXSDValue(), |
— | — | @@ -618,7 +619,7 @@ |
619 | 620 | foreach($propertyValueArray as $value) { |
620 | 621 | if ( $value->getNamespace() == NS_CATEGORY ) { |
621 | 622 | $up_inst2[] = |
622 | | - array('s_id' => $this->makeSMWPageID($subject->getDBkey(),$subject->getNamespace(),''), |
| 623 | + array('s_id' => $sid, |
623 | 624 | 'o_id' => $this->makeSMWPageID($value->getDBkey(),$value->getNamespace(),'')); |
624 | 625 | } |
625 | 626 | } |
— | — | @@ -631,7 +632,7 @@ |
632 | 633 | foreach($propertyValueArray as $value) { |
633 | 634 | if ( $value->getNamespace() == $namespace ) { |
634 | 635 | $up_subs2[] = |
635 | | - array('s_id' => $this->makeSMWPageID($subject->getDBkey(),$subject->getNamespace(),''), |
| 636 | + array('s_id' => $sid, |
636 | 637 | 'o_id' => $this->makeSMWPageID($value->getDBkey(),$value->getNamespace(),'')); |
637 | 638 | } |
638 | 639 | } |
— | — | @@ -642,7 +643,7 @@ |
643 | 644 | $stringvalue = $value->getXSDValue(); |
644 | 645 | } |
645 | 646 | $up_spec2[] = |
646 | | - array('s_id' => $this->makeSMWPageID($subject->getDBkey(),$subject->getNamespace(),''), |
| 647 | + array('s_id' => $sid, |
647 | 648 | 'sp_id' => $property, |
648 | 649 | 'value_string' => $stringvalue); |
649 | 650 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php |
— | — | @@ -922,7 +922,7 @@ |
923 | 923 | if ($stoppattern == '') { |
924 | 924 | $stoppattern = '\[\[|\]\]|::|:=|<q>|<\/q>|^' . $this->m_categoryprefix . '|\|\||\|'; |
925 | 925 | } |
926 | | - $chunks = preg_split('/(' . $stoppattern . ')/u', $this->m_curstring, 2, PREG_SPLIT_DELIM_CAPTURE); |
| 926 | + $chunks = preg_split('/[\s]*(' . $stoppattern . ')/u', $this->m_curstring, 2, PREG_SPLIT_DELIM_CAPTURE); |
927 | 927 | if (count($chunks) == 1) { // no matches anymore, strip spaces and finish |
928 | 928 | if ($consume) { |
929 | 929 | $this->m_curstring = ''; |