<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>99° Labor</title>
	<atom:link href="http://labor.99grad.de/feed" rel="self" type="application/rss+xml" />
	<link>http://labor.99grad.de</link>
	<description></description>
	<pubDate>Wed, 08 Feb 2012 14:42:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wenn indexed_search nicht indiziert</title>
		<link>http://labor.99grad.de/%post-name%</link>
		<comments>http://labor.99grad.de/%post-name%#comments</comments>
		<pubDate>Wed, 08 Feb 2012 14:20:32 +0000</pubDate>
		<dc:creator>david</dc:creator>
		
		<category><![CDATA[indexed_searched checkliste]]></category>

		<guid isPermaLink="false">http://labor.99grad.de/?p=360</guid>
		<description><![CDATA[Das hier ist eine kleine Schritt-für-Schritt Checkliste um zu prüfen, warum indexed_search nicht funktioniert.
1. Prüfe, ob das indexing eingeschaltet ist.
Im TSsetup: page.config.index_enable = 1
2. Prüfe, das Caching deaktiviert wurde.
Die Seiteninhalte werden nur indiziert, wenn sie auch in Typo3 gecached werden, also in eine der Tabellen cf_cache&#8230; wandern. Der absolute indexed_search-Killer ist folglich $GLOBALS["TSFE"]->set_no_cache();
Eingrenzung:
Diese Zeile
if ($GLOBALS['TSFE']->no_cache) [...]]]></description>
			<content:encoded><![CDATA[<p>Das hier ist eine kleine Schritt-für-Schritt Checkliste um zu prüfen, warum indexed_search nicht funktioniert.</p>
<h2>1. Prüfe, ob das indexing eingeschaltet ist.</h2>
<p>Im TSsetup: page.config.index_enable = 1</p>
<h2>2. Prüfe, das Caching deaktiviert wurde.</h2>
<p>Die Seiteninhalte werden nur indiziert, wenn sie auch in Typo3 gecached werden, also in eine der Tabellen cf_cache&#8230; wandern. Der absolute indexed_search-Killer ist folglich $GLOBALS["TSFE"]->set_no_cache();<br />
<strong>Eingrenzung:</strong><br />
Diese Zeile<br />
if ($GLOBALS['TSFE']->no_cache) echo &#8220;No Cache ist aktiviert!&#8221;;<br />
als letzte Zeile in die index.php von Typo3 einfügen. Wenn der Text beim Aufruf der Seite ausgegeben wird, dann nacheinander folgende Sache prüfen:</p>
<ul>
<li>Ist unter den Seiteneigenschaften -> Verhalten -> Cache deaktiviert?</li>
<li>Gibt es im TSsetup diese beiden Zeilen?<br />config.no_cache = 0<br />config.cache = 1</li>
<li>Muss eine Extension speziell zum Cachen konfiguriert werden wie z.B. plugin.tt_news.allowCaching = 1</li>
<li>Ist eine Extension auf der Seite im Einsatz, die im Quelltext set_no_cache(); aufruft?</li>
</ul>
<h2>3. Enthält der Quelltext die Such-Marker?</h2>
<p>Alle Texte, die von der indexed_search durchsucht werden sollen müssen innerhalb dieser Marker sein:<br />
&lt;!&#8211;TYPO3SEARCH_begin&#8211;&gt;<br />
&#8230; dieser Text wird indiziert &#8230;<br />
&lt;!&#8211;TYPO3SEARCH_end&#8211;&gt;</p>
<h2>Typo3 Cache-Tabellen regelmäßig löschen</h2>
<p>Zum Debuggen hilft mir auch dieses kleine PHP-Script, dass alle Cache-Tabellen und Indizierungen löscht. Eignet sich auch gut zum regelmäßigen Leeren der Cache-Tabellen in Typo3, falls z.B. eine Cache-Killer-Extension wie Kaldender &#8220;cal&#8221; im Einsatz ist: Dieses Script als Cron-Job (evtl. ohne die index_&#8230;-Tabellen) regelmäßig aufrufen…</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?php
	require_once<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'typo3conf/localconf.php'</span><span style="color: #66cc66;">&#41;</span>;
	$clean = <span style="color: #0066CC;">array</span><span style="color: #66cc66;">&#40;</span>
		<span style="color: #ff0000;">'cache_extensions'</span>, <span style="color: #ff0000;">'cache_imagesizes'</span>, <span style="color: #ff0000;">'cache_md5params'</span>, <span style="color: #ff0000;">'cache_treelist'</span>, <span style="color: #ff0000;">'cache_typo3temp_log'</span>, <span style="color: #ff0000;">'cf_cache_hash'</span>, <span style="color: #ff0000;">'cf_cache_hash_tags'</span>, <span style="color: #ff0000;">'cf_cache_pages'</span>,
		<span style="color: #ff0000;">'cf_cache_pagesection'</span>, <span style="color: #ff0000;">'cf_cache_pagesection'</span>, <span style="color: #ff0000;">'cf_cache_pagesection_tags'</span>, <span style="color: #ff0000;">'cf_cache_pages_tags'</span>,
		<span style="color: #ff0000;">'index_debug'</span>, <span style="color: #ff0000;">'index_fulltext'</span>, <span style="color: #ff0000;">'index_grlist'</span>, <span style="color: #ff0000;">'index_phash'</span>, <span style="color: #ff0000;">'index_rel'</span>, <span style="color: #ff0000;">'index_section'</span>, <span style="color: #ff0000;">'index_stat_search'</span>, <span style="color: #ff0000;">'index_stat_word'</span>, <span style="color: #ff0000;">'index_words'</span>	
	<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	$link = mysql_connect<span style="color: #66cc66;">&#40;</span>$typo_db_host, $typo_db_username, $typo_db_password<span style="color: #66cc66;">&#41;</span>;
	mysql_select_db<span style="color: #66cc66;">&#40;</span> $typo_db, $link <span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span>$link<span style="color: #66cc66;">&#41;</span> die<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Could not connect to DB&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #b1b100;">foreach</span> <span style="color: #66cc66;">&#40;</span>$clean as $tbl<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		$sql = <span style="color: #ff0000;">&quot;TRUNCATE $tbl;&quot;</span>;
		$result = mysql_query<span style="color: #66cc66;">&#40;</span> $sql <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span>$result<span style="color: #66cc66;">&#41;</span> die<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Could not execute query!&quot;</span>.<span style="color: #006600;">mysql_error</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	mysql_close<span style="color: #66cc66;">&#40;</span>$link<span style="color: #66cc66;">&#41;</span>;
?<span style="color: #66cc66;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://labor.99grad.de/%post-name%/feed</wfw:commentRss>
		</item>
		<item>
		<title>Nach AJAX-Response mit jQuery können Formular-Daten nicht mehr gelesen werden</title>
		<link>http://labor.99grad.de/%post-name%</link>
		<comments>http://labor.99grad.de/%post-name%#comments</comments>
		<pubDate>Wed, 07 Dec 2011 15:16:23 +0000</pubDate>
		<dc:creator>david</dc:creator>
		
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://labor.99grad.de/?p=347</guid>
		<description><![CDATA[Klasse Phänomen mal wieder: Ich habe ein DIV gebaut, dass ein Formular mit einer SELECT-Box enthält. Bei Auswahl einer Option in der SELECT-Box wird per jQuery.ajax(); das DIV neu geladen und dynamisch im Inhalt ersetzt. Klappt bei allen Browsern super - nur der IE8 hat mich den Vormittag gekostet, bis ich mir den Response mal [...]]]></description>
			<content:encoded><![CDATA[<p>Klasse Phänomen mal wieder: Ich habe ein DIV gebaut, dass ein Formular mit einer SELECT-Box enthält. Bei Auswahl einer Option in der SELECT-Box wird per jQuery.ajax(); das DIV neu geladen und dynamisch im Inhalt ersetzt. Klappt bei allen Browsern super - nur der IE8 hat mich den Vormittag gekostet, bis ich mir den Response mal genau angeschaut hatte.</p>
<p>Das Formular bestand - vereinfacht dargestellt - aus folgendem Code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span>=<span style="color: #ff0000;">&quot;mein_formular&quot;</span><span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>form method=<span style="color: #ff0000;">&quot;post&quot;</span> action=<span style="color: #ff0000;">&quot;ziel/&quot;</span> <span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>select <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;auswahl&quot;</span><span style="color: #66cc66;">&gt;</span>
          <span style="color: #66cc66;">&lt;</span>option value=<span style="color: #ff0000;">&quot;wert1&quot;</span><span style="color: #66cc66;">&gt;</span>Wert <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&lt;/</span>option<span style="color: #66cc66;">&gt;</span>
          <span style="color: #66cc66;">&lt;</span>option value=<span style="color: #ff0000;">&quot;wert2&quot;</span><span style="color: #66cc66;">&gt;</span>Wert <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&lt;/</span>option<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;/</span>select<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;/</span>form<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;/</span>div<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>Der jQuery-AJAX-Code sah ungefähr so aus:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> formular = $<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'.mein_formular form'</span><span style="color: #66cc66;">&#41;</span>;
formular.<span style="color: #006600;">find</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'select'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">change</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
   $.<span style="color: #006600;">ajax</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #0066CC;">url</span>: formular.<span style="color: #006600;">attr</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'action'</span><span style="color: #66cc66;">&#41;</span>+<span style="color: #ff0000;">'?'</span>+formular.<span style="color: #006600;">serialize</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, 
		 success: <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">data</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			$<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'.mein_formular'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">html</span><span style="color: #66cc66;">&#40;</span> $<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'.mein_formular'</span>, <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">html</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
                 <span style="color: #66cc66;">&#125;</span>
   <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Im Internet Explorer 8 konnte ich den Ajax-Befehl genau ein Mal aufrufen, danach kam ich nicht mehr an die Daten von formular.serialize() heran. Erst ein genauer Blick in den Response brachte es heraus:<br />
Der Befehl $(&#8217;.mein_formular&#8217;, data).html(); bringt in allen Browsern – außer IE8 – dieses richtige Ergebnis:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">...<span style="color: #66cc66;">&lt;</span>form method=<span style="color: #ff0000;">&quot;post&quot;</span> action=<span style="color: #ff0000;">&quot;ziel/&quot;</span> <span style="color: #66cc66;">&gt;</span>...<span style="color: #66cc66;">&lt;/</span>form<span style="color: #66cc66;">&gt;</span>...</pre></div></div>

<p>Also: Alles korrekt. Im IE8 aber entfernt jQuery.html(); aus irgendeinem irrsinnigen Grund die Anführungszeichen der Tag-Attribute und macht daraus:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">...<span style="color: #66cc66;">&lt;</span>form method=post action=ziel<span style="color: #66cc66;">/</span> <span style="color: #66cc66;">&gt;</span>...<span style="color: #66cc66;">&lt;/</span>form<span style="color: #66cc66;">&gt;</span>...</pre></div></div>

<p>Und das wiederum interpretiert IE8 durch den Slash am Ende von ziel/ als Schliessen des Tags! Also so:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">...<span style="color: #66cc66;">&lt;</span>form method=post action=ziel <span style="color: #66cc66;">/&gt;</span> ...</pre></div></div>

<p>Konsequenz: Keine Chance, an die Daten eines leeren Formulars zu kommen. Vielen Dank, Microsoft!<br />
Und die Lösung dazu? jQuery.html() nicht verwenden, sondern .contents() – mal wieder ein paar Buchstaben, die einem den halben Tag Nerven geraubt haben:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">$<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'.mein_formular'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">html</span><span style="color: #66cc66;">&#40;</span> $<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'.mein_formular'</span>, <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">contents</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Oder – alternativ – einfach das .html() weglassen – allerdings wird dann evtl. das umschliessende DIV gedoppelt.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">$<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'.mein_formular'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">html</span><span style="color: #66cc66;">&#40;</span> $<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'.mein_formular'</span>, <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://labor.99grad.de/%post-name%/feed</wfw:commentRss>
		</item>
	</channel>
</rss>

