1029, three decrees once again denounced Mu'tazilism, condemned the doctrine of Quranic createdness, and reaffirmed the special status of the Rashidun caliphs and the need of "enjoining good and forbidding wrong". This coincided with the campaigns of Mahmud of Ghazni against the Shi'a, the Buyids (Ray was captured in 1029 and Kirman attacked two years later), and the Ghaznavid expansion into India. In 1030, al-Qadir named his son Abu Ja'far, the future al-Qa'im, as his heir, a decision taken completely independently of the Buyid rulers. He died after an illness on 29 November 1031. Initially he was buried in the caliphal palace, but in the next year he was ceremonially moved to al-Rusafa. Legacy Historians generally give a favourable view of al-Qadir as a mild-mannered and gentle person. He went out in disguise among the people, gave alms to the poor, and regularly attended public sessions where the commoners could voice their complaints (). Al-Qadir's reign was an important turning point in the history of the Abbasid caliphate and Sunni Islam. Previous Abbasid caliphs had sympathized with rationalist schools like the Mu'tazilites, and been opposed by the conservative traditionalist Sunni scholars. One of the most notable Sunni scholars, Ahmad ibn Hanbal, founder of the Hanbali school, had been persecuted by the Inquisition-like , founded by Caliph al-Ma'mun (). Al-Qadir on the other hand succeeded in repositioning the caliphate as the champion of conservative Sunnism, specifically of the Hanbali branch. Apart from the decrees issued in his own name, he commissioned works by theologians and jurists. Al-Mawardi's al-Iqna or even his famous al-Ahkam al-Sultaniyya, the Mukhtasars of al-Quduri and Abd al-Wahhab al-Maliki, as well as a refutation of doctrines by Ali ibn Sa'id al-Istakhri, are said to have been composed on his request. According to the 12th/13th-century historian Ibn al-Athir, under al-Qadir, "the caliphate recovered its prestige". His activities, and especially the , were a seminal moment in the history of Sunni Islam. Until then, the Sunnis had defined themselves mostly in opposition to the Shi'a, but "now there was a body of positive belief which had to be accepted by anyone claiming to be a Sunni". At the same time, the condemnation of Shi'a practices created a sharp distinction between the two groups, that had not hitherto been the case. As Hugh Kennedy put it, "it was no longer possible to be simply a Muslim, one was either a Sunni